home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1994-08-09 | 18.5 KB | [TEXT/KAHL] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Tue Aug 9 22:10:01 1994, modified Tue Aug 9 22:10:01 1994, creator Think C, type ASCII, 18356 bytes "FileCopy.c" , at 0x4834 382 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [KAHL] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 46 69 6c 65 43 6f | 70 79 2e 63 00 00 00 00 |..FileCo|py.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 47 b4 00 | 00 01 7e aa 6d e7 79 aa |.....G..|..~.m.y.|
|00000060| 6d e7 79 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |m.y.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 43 66 00 00 |........|....Cf..|
|00000080| 2f 2a 0d 2a 2a 09 41 70 | 70 6c 65 20 4d 61 63 69 |/*.**.Ap|ple Maci|
|00000090| 6e 74 6f 73 68 20 44 65 | 76 65 6c 6f 70 65 72 20 |ntosh De|veloper |
|000000a0| 54 65 63 68 6e 69 63 61 | 6c 20 53 75 70 70 6f 72 |Technica|l Suppor|
|000000b0| 74 0d 2a 2a 0d 2a 2a 09 | 46 69 6c 65 43 6f 70 79 |t.**.**.|FileCopy|
|000000c0| 3a 20 41 20 72 6f 62 75 | 73 74 2c 20 67 65 6e 65 |: A robu|st, gene|
|000000d0| 72 61 6c 20 70 75 72 70 | 6f 73 65 20 66 69 6c 65 |ral purp|ose file|
|000000e0| 20 63 6f 70 79 20 72 6f | 75 74 69 6e 65 2e 0d 2a | copy ro|utine..*|
|000000f0| 2a 0d 2a 2a 09 62 79 20 | 4a 69 6d 20 4c 75 74 68 |*.**.by |Jim Luth|
|00000100| 65 72 2c 20 41 70 70 6c | 65 20 44 65 76 65 6c 6f |er, Appl|e Develo|
|00000110| 70 65 72 20 54 65 63 68 | 6e 69 63 61 6c 20 53 75 |per Tech|nical Su|
|00000120| 70 70 6f 72 74 0d 2a 2a | 0d 2a 2a 09 46 69 6c 65 |pport.**|.**.File|
|00000130| 3a 09 09 46 69 6c 65 43 | 6f 70 79 2e 63 0d 2a 2a |:..FileC|opy.c.**|
|00000140| 0d 2a 2a 09 43 6f 70 79 | 72 69 67 68 74 20 a9 20 |.**.Copy|right . |
|00000150| 31 39 39 32 2d 31 39 39 | 34 20 41 70 70 6c 65 20 |1992-199|4 Apple |
|00000160| 43 6f 6d 70 75 74 65 72 | 2c 20 49 6e 63 2e 0d 2a |Computer|, Inc..*|
|00000170| 2a 09 41 6c 6c 20 72 69 | 67 68 74 73 20 72 65 73 |*.All ri|ghts res|
|00000180| 65 72 76 65 64 2e 0d 2a | 2a 0d 2a 2a 09 59 6f 75 |erved..*|*.**.You|
|00000190| 20 6d 61 79 20 69 6e 63 | 6f 72 70 6f 72 61 74 65 | may inc|orporate|
|000001a0| 20 74 68 69 73 20 73 61 | 6d 70 6c 65 20 63 6f 64 | this sa|mple cod|
|000001b0| 65 20 69 6e 74 6f 20 79 | 6f 75 72 20 61 70 70 6c |e into y|our appl|
|000001c0| 69 63 61 74 69 6f 6e 73 | 20 77 69 74 68 6f 75 74 |ications| without|
|000001d0| 0d 2a 2a 09 72 65 73 74 | 72 69 63 74 69 6f 6e 2c |.**.rest|riction,|
|000001e0| 20 74 68 6f 75 67 68 20 | 74 68 65 20 73 61 6d 70 | though |the samp|
|000001f0| 6c 65 20 63 6f 64 65 20 | 68 61 73 20 62 65 65 6e |le code |has been|
|00000200| 20 70 72 6f 76 69 64 65 | 64 20 22 41 53 20 49 53 | provide|d "AS IS|
|00000210| 22 20 61 6e 64 20 74 68 | 65 0d 2a 2a 09 72 65 73 |" and th|e.**.res|
|00000220| 70 6f 6e 73 69 62 69 6c | 69 74 79 20 66 6f 72 20 |ponsibil|ity for |
|00000230| 69 74 73 20 6f 70 65 72 | 61 74 69 6f 6e 20 69 73 |its oper|ation is|
|00000240| 20 31 30 30 25 20 79 6f | 75 72 73 2e 20 20 48 6f | 100% yo|urs. Ho|
|00000250| 77 65 76 65 72 2c 20 77 | 68 61 74 20 79 6f 75 20 |wever, w|hat you |
|00000260| 61 72 65 0d 2a 2a 09 6e | 6f 74 20 70 65 72 6d 69 |are.**.n|ot permi|
|00000270| 74 74 65 64 20 74 6f 20 | 64 6f 20 69 73 20 74 6f |tted to |do is to|
|00000280| 20 72 65 64 69 73 74 72 | 69 62 75 74 65 20 74 68 | redistr|ibute th|
|00000290| 65 20 73 6f 75 72 63 65 | 20 61 73 20 22 44 53 43 |e source| as "DSC|
|000002a0| 20 53 61 6d 70 6c 65 20 | 43 6f 64 65 22 0d 2a 2a | Sample |Code".**|
|000002b0| 09 61 66 74 65 72 20 68 | 61 76 69 6e 67 20 6d 61 |.after h|aving ma|
|000002c0| 64 65 20 63 68 61 6e 67 | 65 73 2e 20 49 66 20 79 |de chang|es. If y|
|000002d0| 6f 75 27 72 65 20 67 6f | 69 6e 67 20 74 6f 20 72 |ou're go|ing to r|
|000002e0| 65 2d 64 69 73 74 72 69 | 62 75 74 65 20 74 68 65 |e-distri|bute the|
|000002f0| 20 73 6f 75 72 63 65 2c | 0d 2a 2a 09 77 65 20 72 | source,|.**.we r|
|00000300| 65 71 75 69 72 65 20 74 | 68 61 74 20 79 6f 75 20 |equire t|hat you |
|00000310| 6d 61 6b 65 20 69 74 20 | 63 6c 65 61 72 20 69 6e |make it |clear in|
|00000320| 20 74 68 65 20 73 6f 75 | 72 63 65 20 74 68 61 74 | the sou|rce that|
|00000330| 20 74 68 65 20 63 6f 64 | 65 20 77 61 73 0d 2a 2a | the cod|e was.**|
|00000340| 09 64 65 73 63 65 6e 64 | 65 64 20 66 72 6f 6d 20 |.descend|ed from |
|00000350| 41 70 70 6c 65 20 53 61 | 6d 70 6c 65 20 43 6f 64 |Apple Sa|mple Cod|
|00000360| 65 2c 20 62 75 74 20 74 | 68 61 74 20 79 6f 75 27 |e, but t|hat you'|
|00000370| 76 65 20 6d 61 64 65 20 | 63 68 61 6e 67 65 73 2e |ve made |changes.|
|00000380| 0d 2a 2f 0d 0d 23 69 66 | 6e 64 65 66 20 5f 5f 46 |.*/..#if|ndef __F|
|00000390| 49 4c 45 43 4f 50 59 5f | 5f 0d 23 69 6e 63 6c 75 |ILECOPY_|_.#inclu|
|000003a0| 64 65 20 22 46 69 6c 65 | 43 6f 70 79 2e 68 22 0d |de "File|Copy.h".|
|000003b0| 23 65 6e 64 69 66 0d 0d | 0d 2f 2a 2a 2a 2a 2a 2a |#endif..|./******|
|000003c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000003d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000003e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000003f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000400| 2a 2a 2a 2a 2a 2a 2a 2f | 0d 0d 2f 2a 20 6c 6f 63 |*******/|../* loc|
|00000410| 61 6c 20 63 6f 6e 73 74 | 61 6e 74 73 20 2a 2f 0d |al const|ants */.|
|00000420| 0d 2f 2a 09 54 68 65 20 | 64 65 6e 79 2d 6d 6f 64 |./*.The |deny-mod|
|00000430| 65 20 70 72 69 76 69 6c | 65 67 65 73 20 74 6f 20 |e privil|eges to |
|00000440| 75 73 65 20 77 68 65 6e | 20 6f 70 65 6e 69 6e 67 |use when| opening|
|00000450| 20 74 68 65 20 73 6f 75 | 72 63 65 20 61 6e 64 20 | the sou|rce and |
|00000460| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 66 69 6c 65 |destinat|ion file|
|00000470| 73 2e 20 2a 2f 0d 0d 65 | 6e 75 6d 0d 7b 0d 09 73 |s. */..e|num.{..s|
|00000480| 72 63 43 6f 70 79 4d 6f | 64 65 20 3d 20 64 6d 52 |rcCopyMo|de = dmR|
|00000490| 64 44 65 6e 79 57 72 2c | 0d 09 64 73 74 43 6f 70 |dDenyWr,|..dstCop|
|000004a0| 79 4d 6f 64 65 20 3d 20 | 64 6d 57 72 44 65 6e 79 |yMode = |dmWrDeny|
|000004b0| 52 64 57 72 0d 7d 3b 0d | 0d 2f 2a 09 54 68 65 20 |RdWr.};.|./*.The |
|000004c0| 6c 61 72 67 65 73 74 20 | 28 31 36 4b 29 20 61 6e |largest |(16K) an|
|000004d0| 64 20 73 6d 61 6c 6c 65 | 73 74 20 28 2e 35 4b 29 |d smalle|st (.5K)|
|000004e0| 20 63 6f 70 79 20 62 75 | 66 66 65 72 20 74 6f 20 | copy bu|ffer to |
|000004f0| 75 73 65 20 69 66 20 74 | 68 65 20 63 61 6c 6c 65 |use if t|he calle|
|00000500| 72 20 64 6f 65 73 6e 27 | 74 20 73 75 70 70 6c 79 |r doesn'|t supply|
|00000510| 20 0d 2a 2a 09 74 68 65 | 69 72 20 6f 77 6e 20 63 | .**.the|ir own c|
|00000520| 6f 70 79 20 62 75 66 66 | 65 72 2e 20 2a 2f 0d 0d |opy buff|er. */..|
|00000530| 65 6e 75 6d 0d 7b 0d 09 | 62 69 67 43 6f 70 79 42 |enum.{..|bigCopyB|
|00000540| 75 66 66 53 69 7a 65 20 | 20 3d 20 30 78 30 30 30 |uffSize | = 0x000|
|00000550| 30 34 30 30 30 2c 0d 09 | 6d 69 6e 43 6f 70 79 42 |04000,..|minCopyB|
|00000560| 75 66 66 53 69 7a 65 20 | 20 3d 20 30 78 30 30 30 |uffSize | = 0x000|
|00000570| 30 30 32 30 30 0d 7d 3b | 0d 0d 2f 2a 2a 2a 2a 2a |00200.};|../*****|
|00000580| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000590| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000005a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000005b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000005c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2f 0d 0d 2f 2a 20 73 74 |********|/../* st|
|000005d0| 61 74 69 63 20 70 72 6f | 74 6f 74 79 70 65 73 20 |atic pro|totypes |
|000005e0| 2a 2f 0d 0d 73 74 61 74 | 69 63 09 4f 53 45 72 72 |*/..stat|ic.OSErr|
|000005f0| 09 47 65 74 44 65 73 74 | 69 6e 61 74 69 6f 6e 44 |.GetDest|inationD|
|00000600| 69 72 49 6e 66 6f 28 73 | 68 6f 72 74 20 76 52 65 |irInfo(s|hort vRe|
|00000610| 66 4e 75 6d 2c 0d 09 09 | 09 09 09 09 09 09 09 20 |fNum,...|....... |
|00000620| 20 6c 6f 6e 67 20 64 69 | 72 49 44 2c 0d 09 09 09 | long di|rID,....|
|00000630| 09 09 09 09 09 09 20 20 | 53 74 72 69 6e 67 50 74 |...... |StringPt|
|00000640| 72 20 6e 61 6d 65 2c 0d | 09 09 09 09 09 09 09 09 |r name,.|........|
|00000650| 09 20 20 6c 6f 6e 67 20 | 2a 74 68 65 44 69 72 49 |. long |*theDirI|
|00000660| 44 2c 0d 09 09 09 09 09 | 09 09 09 09 20 20 42 6f |D,......|.... Bo|
|00000670| 6f 6c 65 61 6e 20 2a 69 | 73 44 69 72 65 63 74 6f |olean *i|sDirecto|
|00000680| 72 79 2c 0d 09 09 09 09 | 09 09 09 09 09 20 20 42 |ry,.....|..... B|
|00000690| 6f 6f 6c 65 61 6e 20 2a | 69 73 44 72 6f 70 42 6f |oolean *|isDropBo|
|000006a0| 78 29 3b 0d 2f 2a 09 47 | 65 74 44 65 73 74 69 6e |x);./*.G|etDestin|
|000006b0| 61 74 69 6f 6e 44 69 72 | 49 6e 66 6f 20 74 65 6c |ationDir|Info tel|
|000006c0| 6c 73 20 75 73 20 69 66 | 20 74 68 65 20 64 65 73 |ls us if| the des|
|000006d0| 74 69 6e 61 74 69 6f 6e | 20 69 73 20 61 20 64 69 |tination| is a di|
|000006e0| 72 65 63 74 6f 72 79 2c | 20 69 66 20 69 74 27 73 |rectory,| if it's|
|000006f0| 0d 09 64 69 72 65 63 74 | 6f 72 79 20 49 44 2c 20 |..direct|ory ID, |
|00000700| 61 6e 64 20 69 66 20 69 | 74 27 73 20 61 6e 20 41 |and if i|t's an A|
|00000710| 70 70 6c 65 53 68 61 72 | 65 20 64 72 6f 70 20 62 |ppleShar|e drop b|
|00000720| 6f 78 20 28 77 72 69 74 | 65 20 70 72 69 76 69 6c |ox (writ|e privil|
|00000730| 65 67 65 73 20 6f 6e 6c | 79 20 2d 2d 0d 09 6e 6f |eges onl|y --..no|
|00000740| 20 72 65 61 64 20 6f 72 | 20 73 65 61 72 63 68 20 | read or| search |
|00000750| 70 72 69 76 69 6c 65 67 | 65 73 29 2e 0d 09 76 52 |privileg|es)...vR|
|00000760| 65 66 4e 75 6d 09 09 69 | 6e 70 75 74 3a 09 56 6f |efNum..i|nput:.Vo|
|00000770| 6c 75 6d 65 20 73 70 65 | 63 69 66 69 63 61 74 69 |lume spe|cificati|
|00000780| 6f 6e 20 6f 66 20 74 68 | 65 20 66 69 6c 65 27 73 |on of th|e file's|
|00000790| 20 63 75 72 72 65 6e 74 | 0d 09 09 09 09 09 09 09 | current|........|
|000007a0| 6c 6f 63 61 74 69 6f 6e | 2e 0d 09 64 69 72 49 44 |location|...dirID|
|000007b0| 09 09 69 6e 70 75 74 3a | 09 44 69 72 65 63 74 6f |..input:|.Directo|
|000007c0| 72 79 20 49 44 20 6f 66 | 20 74 68 65 20 66 69 6c |ry ID of| the fil|
|000007d0| 65 27 73 20 63 75 72 72 | 65 6e 74 20 6c 6f 63 61 |e's curr|ent loca|
|000007e0| 74 69 6f 6e 2e 0d 09 6e | 61 6d 65 09 09 69 6e 70 |tion...n|ame..inp|
|000007f0| 75 74 3a 09 54 68 65 20 | 6e 61 6d 65 20 6f 66 20 |ut:.The |name of |
|00000800| 74 68 65 20 66 69 6c 65 | 2e 0d 09 74 68 65 44 69 |the file|...theDi|
|00000810| 72 49 44 09 6f 75 74 70 | 75 74 3a 09 49 66 20 74 |rID.outp|ut:.If t|
|00000820| 68 65 20 6f 62 6a 65 63 | 74 20 69 73 20 61 20 66 |he objec|t is a f|
|00000830| 69 6c 65 2c 20 74 68 65 | 6e 20 69 74 73 20 70 61 |ile, the|n its pa|
|00000840| 72 65 6e 74 20 64 69 72 | 65 63 74 6f 72 79 0d 09 |rent dir|ectory..|
|00000850| 09 09 09 09 09 49 44 2e | 20 49 66 20 74 68 65 20 |.....ID.| If the |
|00000860| 6f 62 6a 65 63 74 20 69 | 73 20 61 20 64 69 72 65 |object i|s a dire|
|00000870| 63 74 6f 72 79 2c 20 74 | 68 65 6e 20 69 74 73 20 |ctory, t|hen its |
|00000880| 49 44 2e 0d 09 69 73 44 | 69 72 65 63 74 6f 72 79 |ID...isD|irectory|
|00000890| 09 6f 75 74 70 75 74 3a | 09 54 72 75 65 20 69 66 |.output:|.True if|
|000008a0| 20 6f 62 6a 65 63 74 20 | 69 73 20 61 20 64 69 72 | object |is a dir|
|000008b0| 65 63 74 6f 72 79 3b 20 | 66 61 6c 73 65 20 69 66 |ectory; |false if|
|000008c0| 0d 09 09 09 09 09 09 6f | 62 6a 65 63 74 20 69 73 |.......o|bject is|
|000008d0| 20 61 20 66 69 6c 65 2e | 0d 09 69 73 44 72 6f 70 | a file.|..isDrop|
|000008e0| 42 6f 78 09 6f 75 74 70 | 75 74 3a 09 54 72 75 65 |Box.outp|ut:.True|
|000008f0| 20 69 66 20 64 69 72 65 | 63 74 6f 72 79 20 69 73 | if dire|ctory is|
|00000900| 20 61 6e 20 41 70 70 6c | 65 53 68 61 72 65 20 64 | an Appl|eShare d|
|00000910| 72 6f 70 20 62 6f 78 2e | 0d 2a 2f 0d 0d 73 74 61 |rop box.|.*/..sta|
|00000920| 74 69 63 09 4f 53 45 72 | 72 09 43 68 65 63 6b 46 |tic.OSEr|r.CheckF|
|00000930| 6f 72 46 6f 72 6b 73 28 | 73 68 6f 72 74 20 76 52 |orForks(|short vR|
|00000940| 65 66 4e 75 6d 2c 0d 09 | 09 09 09 09 09 09 20 20 |efNum,..|...... |
|00000950| 6c 6f 6e 67 20 64 69 72 | 49 44 2c 0d 09 09 09 09 |long dir|ID,.....|
|00000960| 09 09 09 20 20 43 6f 6e | 73 74 53 74 72 32 35 35 |... Con|stStr255|
|00000970| 50 61 72 61 6d 20 6e 61 | 6d 65 2c 0d 09 09 09 09 |Param na|me,.....|
|00000980| 09 09 09 20 20 42 6f 6f | 6c 65 61 6e 20 2a 68 61 |... Boo|lean *ha|
|00000990| 73 44 61 74 61 46 6f 72 | 6b 2c 0d 09 09 09 09 09 |sDataFor|k,......|
|000009a0| 09 09 20 20 42 6f 6f 6c | 65 61 6e 20 2a 68 61 73 |.. Bool|ean *has|
|000009b0| 52 65 73 6f 75 72 63 65 | 46 6f 72 6b 29 3b 0d 2f |Resource|Fork);./|
|000009c0| 2a 09 43 68 65 63 6b 46 | 6f 72 46 6f 72 6b 73 20 |*.CheckF|orForks |
|000009d0| 74 65 6c 6c 73 20 75 73 | 20 69 66 20 74 68 65 72 |tells us| if ther|
|000009e0| 65 20 69 73 20 61 20 64 | 61 74 61 20 6f 72 20 72 |e is a d|ata or r|
|000009f0| 65 73 6f 75 72 63 65 20 | 66 6f 72 6b 20 74 6f 20 |esource |fork to |
|00000a00| 63 6f 70 79 2e 0d 09 76 | 52 65 66 4e 75 6d 09 09 |copy...v|RefNum..|
|00000a10| 69 6e 70 75 74 3a 09 56 | 6f 6c 75 6d 65 20 73 70 |input:.V|olume sp|
|00000a20| 65 63 69 66 69 63 61 74 | 69 6f 6e 20 6f 66 20 74 |ecificat|ion of t|
|00000a30| 68 65 20 66 69 6c 65 27 | 73 20 63 75 72 72 65 6e |he file'|s curren|
|00000a40| 74 0d 09 09 09 09 09 09 | 09 6c 6f 63 61 74 69 6f |t.......|.locatio|
|00000a50| 6e 2e 0d 09 64 69 72 49 | 44 09 09 69 6e 70 75 74 |n...dirI|D..input|
|00000a60| 3a 09 44 69 72 65 63 74 | 6f 72 79 20 49 44 20 6f |:.Direct|ory ID o|
|00000a70| 66 20 74 68 65 20 66 69 | 6c 65 27 73 20 63 75 72 |f the fi|le's cur|
|00000a80| 72 65 6e 74 20 6c 6f 63 | 61 74 69 6f 6e 2e 0d 09 |rent loc|ation...|
|00000a90| 6e 61 6d 65 09 09 69 6e | 70 75 74 3a 09 54 68 65 |name..in|put:.The|
|00000aa0| 20 6e 61 6d 65 20 6f 66 | 20 74 68 65 20 66 69 6c | name of| the fil|
|00000ab0| 65 2e 0d 2a 2f 0d 0d 73 | 74 61 74 69 63 09 4f 53 |e..*/..s|tatic.OS|
|00000ac0| 45 72 72 09 50 72 65 66 | 6c 69 67 68 74 46 69 6c |Err.Pref|lightFil|
|00000ad0| 65 43 6f 70 79 53 70 61 | 63 65 28 73 68 6f 72 74 |eCopySpa|ce(short|
|00000ae0| 20 73 72 63 56 52 65 66 | 4e 75 6d 2c 0d 09 09 09 | srcVRef|Num,....|
|00000af0| 09 09 09 09 09 09 20 20 | 20 6c 6f 6e 67 20 73 72 |...... | long sr|
|00000b00| 63 44 69 72 49 44 2c 0d | 09 09 09 09 09 09 09 09 |cDirID,.|........|
|00000b10| 09 20 20 20 43 6f 6e 73 | 74 53 74 72 32 35 35 50 |. Cons|tStr255P|
|00000b20| 61 72 61 6d 20 73 72 63 | 4e 61 6d 65 2c 0d 09 09 |aram src|Name,...|
|00000b30| 09 09 09 09 09 09 09 20 | 20 20 53 74 72 69 6e 67 |....... | String|
|00000b40| 50 74 72 20 64 73 74 56 | 6f 6c 4e 61 6d 65 2c 0d |Ptr dstV|olName,.|
|00000b50| 09 09 09 09 09 09 09 09 | 09 20 20 20 73 68 6f 72 |........|. shor|
|00000b60| 74 20 64 73 74 56 52 65 | 66 4e 75 6d 2c 0d 09 09 |t dstVRe|fNum,...|
|00000b70| 09 09 09 09 09 09 09 20 | 20 20 42 6f 6f 6c 65 61 |....... | Boolea|
|00000b80| 6e 20 2a 73 70 61 63 65 | 4f 4b 29 3b 0d 2f 2a 09 |n *space|OK);./*.|
|00000b90| 50 72 65 66 6c 69 67 68 | 74 46 69 6c 65 43 6f 70 |Prefligh|tFileCop|
|00000ba0| 79 53 70 61 63 65 20 64 | 65 74 65 72 6d 69 6e 65 |ySpace d|etermine|
|00000bb0| 73 20 69 66 20 74 68 65 | 72 65 27 73 20 65 6e 6f |s if the|re's eno|
|00000bc0| 75 67 68 20 73 70 61 63 | 65 20 6f 6e 20 61 0d 09 |ugh spac|e on a..|
|00000bd0| 76 6f 6c 75 6d 65 20 74 | 6f 20 63 6f 70 79 20 74 |volume t|o copy t|
|00000be0| 68 65 20 73 70 65 63 69 | 66 69 65 64 20 66 69 6c |he speci|fied fil|
|00000bf0| 65 20 74 6f 20 74 68 61 | 74 20 76 6f 6c 75 6d 65 |e to tha|t volume|
|00000c00| 2e 0d 09 4e 6f 74 65 3a | 20 54 68 65 20 72 65 73 |...Note:| The res|
|00000c10| 75 6c 74 73 20 6f 66 20 | 74 68 69 73 20 72 6f 75 |ults of |this rou|
|00000c20| 74 69 6e 65 20 61 72 65 | 20 6e 6f 74 20 70 65 72 |tine are| not per|
|00000c30| 66 65 63 74 2e 20 46 6f | 72 20 65 78 61 6d 70 6c |fect. Fo|r exampl|
|00000c40| 65 20 69 66 20 74 68 65 | 0d 09 76 6f 6c 75 6d 65 |e if the|..volume|
|00000c50| 27 73 20 63 61 74 61 6c | 6f 67 20 6f 72 20 65 78 |'s catal|og or ex|
|00000c60| 74 65 6e 74 73 20 6f 76 | 65 72 66 6c 6f 77 20 66 |tents ov|erflow f|
|00000c70| 69 6c 65 20 67 72 6f 77 | 73 20 77 68 65 6e 20 74 |ile grow|s when t|
|00000c80| 68 65 20 6e 65 77 20 66 | 69 6c 65 20 69 73 0d 09 |he new f|ile is..|
|00000c90| 63 72 65 61 74 65 64 2c | 20 6d 6f 72 65 20 61 6c |created,| more al|
|00000ca0| 6c 6f 63 61 74 69 6f 6e | 20 62 6c 6f 63 6b 73 20 |location| blocks |
|00000cb0| 6d 61 79 20 62 65 20 6e | 65 65 64 65 64 20 62 65 |may be n|eeded be|
|00000cc0| 79 6f 6e 64 20 74 68 6f | 73 65 20 6e 65 65 64 65 |yond tho|se neede|
|00000cd0| 64 20 66 6f 72 0d 09 74 | 68 65 20 66 69 6c 65 27 |d for..t|he file'|
|00000ce0| 73 20 64 61 74 61 20 61 | 6e 64 20 72 65 73 6f 75 |s data a|nd resou|
|00000cf0| 72 63 65 20 66 6f 72 6b | 73 2e 0d 0d 09 73 72 63 |rce fork|s....src|
|00000d00| 56 52 65 66 4e 75 6d 09 | 09 69 6e 70 75 74 3a 09 |VRefNum.|.input:.|
|00000d10| 56 6f 6c 75 6d 65 20 73 | 70 65 63 69 66 69 63 61 |Volume s|pecifica|
|00000d20| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 66 69 6c 65 |tion of |the file|
|00000d30| 27 73 20 63 75 72 72 65 | 6e 74 0d 09 09 09 09 09 |'s curre|nt......|
|00000d40| 09 09 6c 6f 63 61 74 69 | 6f 6e 2e 0d 09 73 72 63 |..locati|on...src|
|00000d50| 44 69 72 49 44 09 09 69 | 6e 70 75 74 3a 09 44 69 |DirID..i|nput:.Di|
|00000d60| 72 65 63 74 6f 72 79 20 | 49 44 20 6f 66 20 74 68 |rectory |ID of th|
|00000d70| 65 20 66 69 6c 65 27 73 | 20 63 75 72 72 65 6e 74 |e file's| current|
|00000d80| 20 6c 6f 63 61 74 69 6f | 6e 2e 0d 09 73 72 63 4e | locatio|n...srcN|
|00000d90| 61 6d 65 09 09 09 69 6e | 70 75 74 3a 09 54 68 65 |ame...in|put:.The|
|00000da0| 20 6e 61 6d 65 20 6f 66 | 20 74 68 65 20 66 69 6c | name of| the fil|
|00000db0| 65 2e 0d 09 64 73 74 56 | 6f 6c 4e 61 6d 65 09 09 |e...dstV|olName..|
|00000dc0| 69 6e 70 75 74 3a 09 41 | 20 70 6f 69 6e 74 65 72 |input:.A| pointer|
|00000dd0| 20 74 6f 20 74 68 65 20 | 6e 61 6d 65 20 6f 66 20 | to the |name of |
|00000de0| 74 68 65 20 76 6f 6c 75 | 6d 65 20 77 68 65 72 65 |the volu|me where|
|00000df0| 0d 09 09 09 09 09 09 09 | 74 68 65 20 66 69 6c 65 |........|the file|
|00000e00| 20 77 69 6c 6c 20 62 65 | 20 63 6f 70 69 65 64 20 | will be| copied |
|00000e10| 6f 72 20 4e 55 4c 4c 2e | 0d 09 64 73 74 56 52 65 |or NULL.|..dstVRe|
|00000e20| 66 4e 75 6d 09 09 69 6e | 70 75 74 3a 09 56 6f 6c |fNum..in|put:.Vol|
|00000e30| 75 6d 65 20 73 70 65 63 | 69 66 69 63 61 74 69 6f |ume spec|ificatio|
|00000e40| 6e 20 69 6e 64 69 63 61 | 74 69 6e 67 20 74 68 65 |n indica|ting the|
|00000e50| 20 76 6f 6c 75 6d 65 0d | 09 09 09 09 09 09 09 77 | volume.|.......w|
|00000e60| 68 65 72 65 20 74 68 65 | 20 66 69 6c 65 20 77 69 |here the| file wi|
|00000e70| 6c 6c 20 62 65 20 63 6f | 70 69 65 64 2e 0d 09 73 |ll be co|pied...s|
|00000e80| 70 61 63 65 4f 4b 09 09 | 09 6f 75 74 70 75 74 3a |paceOK..|.output:|
|00000e90| 09 74 72 75 65 20 69 66 | 20 74 68 65 72 65 27 73 |.true if| there's|
|00000ea0| 20 65 6e 6f 75 67 68 20 | 73 70 61 63 65 20 6f 6e | enough |space on|
|00000eb0| 20 74 68 65 20 76 6f 6c | 75 6d 65 20 66 6f 72 0d | the vol|ume for.|
|00000ec0| 09 09 09 09 09 09 09 74 | 68 65 20 66 69 6c 65 27 |.......t|he file'|
|00000ed0| 73 20 64 61 74 61 20 61 | 6e 64 20 72 65 73 6f 75 |s data a|nd resou|
|00000ee0| 72 63 65 20 66 6f 72 6b | 73 2e 0d 2a 2f 0d 0d 2f |rce fork|s..*/../|
|00000ef0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000f00| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000f10| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000f20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000f30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2f 0d 0d |********|*****/..|
|00000f40| 73 74 61 74 69 63 09 4f | 53 45 72 72 09 47 65 74 |static.O|SErr.Get|
|00000f50| 44 65 73 74 69 6e 61 74 | 69 6f 6e 44 69 72 49 6e |Destinat|ionDirIn|
|00000f60| 66 6f 28 73 68 6f 72 74 | 20 76 52 65 66 4e 75 6d |fo(short| vRefNum|
|00000f70| 2c 0d 09 09 09 09 09 09 | 09 09 09 20 20 6c 6f 6e |,.......|... lon|
|00000f80| 67 20 64 69 72 49 44 2c | 0d 09 09 09 09 09 09 09 |g dirID,|........|
|00000f90| 09 09 20 20 53 74 72 69 | 6e 67 50 74 72 20 6e 61 |.. Stri|ngPtr na|
|00000fa0| 6d 65 2c 0d 09 09 09 09 | 09 09 09 09 09 20 20 6c |me,.....|..... l|
|00000fb0| 6f 6e 67 20 2a 74 68 65 | 44 69 72 49 44 2c 0d 09 |ong *the|DirID,..|
|00000fc0| 09 09 09 09 09 09 09 09 | 20 20 42 6f 6f 6c 65 61 |........| Boolea|
|00000fd0| 6e 20 2a 69 73 44 69 72 | 65 63 74 6f 72 79 2c 0d |n *isDir|ectory,.|
|00000fe0| 09 09 09 09 09 09 09 09 | 09 20 20 42 6f 6f 6c 65 |........|. Boole|
|00000ff0| 61 6e 20 2a 69 73 44 72 | 6f 70 42 6f 78 29 0d 7b |an *isDr|opBox).{|
|00001000| 0d 09 43 49 6e 66 6f 50 | 42 52 65 63 20 70 62 3b |..CInfoP|BRec pb;|
|00001010| 0d 09 4f 53 45 72 72 20 | 65 72 72 6f 72 3b 0d 0d |..OSErr |error;..|
|00001020| 09 70 62 2e 64 69 72 49 | 6e 66 6f 2e 69 6f 4e 61 |.pb.dirI|nfo.ioNa|
|00001030| 6d 65 50 74 72 20 3d 20 | 6e 61 6d 65 3b 0d 09 70 |mePtr = |name;..p|
|00001040| 62 2e 64 69 72 49 6e 66 | 6f 2e 69 6f 56 52 65 66 |b.dirInf|o.ioVRef|
|00001050| 4e 75 6d 20 3d 20 76 52 | 65 66 4e 75 6d 3b 0d 09 |Num = vR|efNum;..|
|00001060| 70 62 2e 64 69 72 49 6e | 66 6f 2e 69 6f 44 72 44 |pb.dirIn|fo.ioDrD|
|00001070| 69 72 49 44 20 3d 20 64 | 69 72 49 44 3b 0d 09 70 |irID = d|irID;..p|
|00001080| 62 2e 64 69 72 49 6e 66 | 6f 2e 69 6f 46 44 69 72 |b.dirInf|o.ioFDir|
|00001090| 49 6e 64 65 78 20 3d 20 | 30 3b 09 2f 2a 20 75 73 |Index = |0;./* us|
|000010a0| 65 20 69 6f 4e 61 6d 65 | 50 74 72 20 61 6e 64 20 |e ioName|Ptr and |
|000010b0| 69 6f 44 69 72 49 44 20 | 2a 2f 0d 09 70 62 2e 64 |ioDirID |*/..pb.d|
|000010c0| 69 72 49 6e 66 6f 2e 66 | 69 6c 6c 65 72 32 20 3d |irInfo.f|iller2 =|
|000010d0| 20 30 3b 09 09 2f 2a 20 | 66 69 6c 6c 65 72 32 20 | 0;../* |filler2 |
|000010e0| 3d 20 69 6f 41 43 55 73 | 65 72 2c 20 63 6c 65 61 |= ioACUs|er, clea|
|000010f0| 72 20 69 74 20 62 65 66 | 6f 72 65 20 63 61 6c 6c |r it bef|ore call|
|00001100| 69 6e 67 20 47 65 74 43 | 61 74 49 6e 66 6f 20 2a |ing GetC|atInfo *|
|00001110| 2f 0d 09 65 72 72 6f 72 | 20 3d 20 50 42 47 65 74 |/..error| = PBGet|
|00001120| 43 61 74 49 6e 66 6f 53 | 79 6e 63 28 26 70 62 29 |CatInfoS|ync(&pb)|
|00001130| 3b 0d 09 2a 74 68 65 44 | 69 72 49 44 20 3d 20 70 |;..*theD|irID = p|
|00001140| 62 2e 64 69 72 49 6e 66 | 6f 2e 69 6f 44 72 44 69 |b.dirInf|o.ioDrDi|
|00001150| 72 49 44 3b 0d 09 2a 69 | 73 44 69 72 65 63 74 6f |rID;..*i|sDirecto|
|00001160| 72 79 20 3d 20 28 70 62 | 2e 64 69 72 49 6e 66 6f |ry = (pb|.dirInfo|
|00001170| 2e 69 6f 46 6c 41 74 74 | 72 69 62 20 26 20 69 6f |.ioFlAtt|rib & io|
|00001180| 44 69 72 4d 61 73 6b 29 | 20 21 3d 20 30 3b 0d 09 |DirMask)| != 0;..|
|00001190| 2f 2a 20 73 65 65 20 69 | 66 20 61 63 63 65 73 73 |/* see i|f access|
|000011a0| 20 70 72 69 76 69 6c 65 | 64 67 65 73 20 61 72 65 | privile|dges are|
|000011b0| 20 6d 61 6b 65 20 63 68 | 61 6e 67 65 73 2c 20 6e | make ch|anges, n|
|000011c0| 6f 74 20 73 65 65 20 66 | 6f 6c 64 65 72 2c 20 61 |ot see f|older, a|
|000011d0| 6e 64 20 6e 6f 74 20 73 | 65 65 20 66 69 6c 65 73 |nd not s|ee files|
|000011e0| 20 28 64 72 6f 70 20 62 | 6f 78 29 20 2a 2f 0d 09 | (drop b|ox) */..|
|000011f0| 2a 69 73 44 72 6f 70 42 | 6f 78 20 3d 20 28 28 70 |*isDropB|ox = ((p|
|00001200| 62 2e 64 69 72 49 6e 66 | 6f 2e 66 69 6c 6c 65 72 |b.dirInf|o.filler|
|00001210| 32 20 26 20 30 78 30 37 | 29 20 3d 3d 20 30 78 30 |2 & 0x07|) == 0x0|
|00001220| 33 29 3b 0d 09 72 65 74 | 75 72 6e 20 28 20 65 72 |3);..ret|urn ( er|
|00001230| 72 6f 72 20 29 3b 0d 7d | 0d 0d 2f 2a 2a 2a 2a 2a |ror );.}|../*****|
|00001240| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001250| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001260| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001270| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001280| 2a 2a 2a 2a 2a 2a 2a 2a | 2f 0d 0d 73 74 61 74 69 |********|/..stati|
|00001290| 63 09 4f 53 45 72 72 09 | 43 68 65 63 6b 46 6f 72 |c.OSErr.|CheckFor|
|000012a0| 46 6f 72 6b 73 28 73 68 | 6f 72 74 20 76 52 65 66 |Forks(sh|ort vRef|
|000012b0| 4e 75 6d 2c 0d 09 09 09 | 09 09 09 09 20 20 6c 6f |Num,....|.... lo|
|000012c0| 6e 67 20 64 69 72 49 44 | 2c 0d 09 09 09 09 09 09 |ng dirID|,.......|
|000012d0| 09 20 20 43 6f 6e 73 74 | 53 74 72 32 35 35 50 61 |. Const|Str255Pa|
|000012e0| 72 61 6d 20 6e 61 6d 65 | 2c 0d 09 09 09 09 09 09 |ram name|,.......|
|000012f0| 09 20 20 42 6f 6f 6c 65 | 61 6e 20 2a 68 61 73 44 |. Boole|an *hasD|
|00001300| 61 74 61 46 6f 72 6b 2c | 0d 09 09 09 09 09 09 09 |ataFork,|........|
|00001310| 20 20 42 6f 6f 6c 65 61 | 6e 20 2a 68 61 73 52 65 | Boolea|n *hasRe|
|00001320| 73 6f 75 72 63 65 46 6f | 72 6b 29 0d 7b 0d 09 48 |sourceFo|rk).{..H|
|00001330| 50 61 72 61 6d 42 6c 6f | 63 6b 52 65 63 20 70 62 |ParamBlo|ckRec pb|
|00001340| 3b 0d 09 4f 53 45 72 72 | 20 65 72 72 6f 72 3b 0d |;..OSErr| error;.|
|00001350| 09 0d 09 70 62 2e 66 69 | 6c 65 50 61 72 61 6d 2e |...pb.fi|leParam.|
|00001360| 69 6f 4e 61 6d 65 50 74 | 72 20 3d 20 28 53 74 72 |ioNamePt|r = (Str|
|00001370| 69 6e 67 50 74 72 29 6e | 61 6d 65 3b 0d 09 70 62 |ingPtr)n|ame;..pb|
|00001380| 2e 66 69 6c 65 50 61 72 | 61 6d 2e 69 6f 56 52 65 |.filePar|am.ioVRe|
|00001390| 66 4e 75 6d 20 3d 20 76 | 52 65 66 4e 75 6d 3b 0d |fNum = v|RefNum;.|
|000013a0| 09 70 62 2e 66 69 6c 65 | 50 61 72 61 6d 2e 69 6f |.pb.file|Param.io|
|000013b0| 46 56 65 72 73 4e 75 6d | 20 3d 20 30 3b 0d 09 70 |FVersNum| = 0;..p|
|000013c0| 62 2e 66 69 6c 65 50 61 | 72 61 6d 2e 69 6f 44 69 |b.filePa|ram.ioDi|
|000013d0| 72 49 44 20 3d 20 64 69 | 72 49 44 3b 0d 09 70 62 |rID = di|rID;..pb|
|000013e0| 2e 66 69 6c 65 50 61 72 | 61 6d 2e 69 6f 46 44 69 |.filePar|am.ioFDi|
|000013f0| 72 49 6e 64 65 78 20 3d | 20 30 3b 0d 09 65 72 72 |rIndex =| 0;..err|
|00001400| 6f 72 20 3d 20 50 42 48 | 47 65 74 46 49 6e 66 6f |or = PBH|GetFInfo|
|00001410| 53 79 6e 63 28 26 70 62 | 29 3b 0d 09 69 66 20 28 |Sync(&pb|);..if (|
|00001420| 20 65 72 72 6f 72 20 3d | 3d 20 6e 6f 45 72 72 20 | error =|= noErr |
|00001430| 29 0d 09 7b 0d 09 09 2a | 68 61 73 44 61 74 61 46 |)..{...*|hasDataF|
|00001440| 6f 72 6b 20 3d 20 28 70 | 62 2e 66 69 6c 65 50 61 |ork = (p|b.filePa|
|00001450| 72 61 6d 2e 69 6f 46 6c | 4c 67 4c 65 6e 20 21 3d |ram.ioFl|LgLen !=|
|00001460| 20 30 29 3b 0d 09 09 2a | 68 61 73 52 65 73 6f 75 | 0);...*|hasResou|
|00001470| 72 63 65 46 6f 72 6b 20 | 3d 20 28 70 62 2e 66 69 |rceFork |= (pb.fi|
|00001480| 6c 65 50 61 72 61 6d 2e | 69 6f 46 6c 52 4c 67 4c |leParam.|ioFlRLgL|
|00001490| 65 6e 20 21 3d 20 30 29 | 3b 0d 09 7d 0d 09 0d 09 |en != 0)|;..}....|
|000014a0| 72 65 74 75 72 6e 20 28 | 20 65 72 72 6f 72 20 29 |return (| error )|
|000014b0| 3b 0d 7d 0d 0d 2f 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |;.}../**|********|
|000014c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000014d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000014e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000014f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001500| 2a 2a 2a 2f 0d 0d 73 74 | 61 74 69 63 09 4f 53 45 |***/..st|atic.OSE|
|00001510| 72 72 09 50 72 65 66 6c | 69 67 68 74 46 69 6c 65 |rr.Prefl|ightFile|
|00001520| 43 6f 70 79 53 70 61 63 | 65 28 73 68 6f 72 74 20 |CopySpac|e(short |
|00001530| 73 72 63 56 52 65 66 4e | 75 6d 2c 0d 09 09 09 09 |srcVRefN|um,.....|
|00001540| 09 09 09 09 09 20 20 20 | 6c 6f 6e 67 20 73 72 63 |..... |long src|
|00001550| 44 69 72 49 44 2c 0d 09 | 09 09 09 09 09 09 09 09 |DirID,..|........|
|00001560| 20 20 20 43 6f 6e 73 74 | 53 74 72 32 35 35 50 61 | Const|Str255Pa|
|00001570| 72 61 6d 20 73 72 63 4e | 61 6d 65 2c 0d 09 09 09 |ram srcN|ame,....|
|00001580| 09 09 09 09 09 09 20 20 | 20 53 74 72 69 6e 67 50 |...... | StringP|
|00001590| 74 72 20 64 73 74 56 6f | 6c 4e 61 6d 65 2c 0d 09 |tr dstVo|lName,..|
|000015a0| 09 09 09 09 09 09 09 09 | 20 20 20 73 68 6f 72 74 |........| short|
|000015b0| 20 64 73 74 56 52 65 66 | 4e 75 6d 2c 0d 09 09 09 | dstVRef|Num,....|
|000015c0| 09 09 09 09 09 09 20 20 | 20 42 6f 6f 6c 65 61 6e |...... | Boolean|
|000015d0| 20 2a 73 70 61 63 65 4f | 4b 29 0d 7b 0d 09 48 50 | *spaceO|K).{..HP|
|000015e0| 61 72 61 6d 42 6c 6f 63 | 6b 52 65 63 20 70 62 3b |aramBloc|kRec pb;|
|000015f0| 0d 09 4f 53 45 72 72 20 | 65 72 72 6f 72 3b 0d 09 |..OSErr |error;..|
|00001600| 53 74 72 32 35 35 20 74 | 65 6d 70 50 61 74 68 6e |Str255 t|empPathn|
|00001610| 61 6d 65 3b 0d 09 75 6e | 73 69 67 6e 65 64 20 73 |ame;..un|signed s|
|00001620| 68 6f 72 74 20 64 73 74 | 46 72 65 65 42 6c 6f 63 |hort dst|FreeBloc|
|00001630| 6b 73 3b 0d 09 75 6e 73 | 69 67 6e 65 64 20 73 68 |ks;..uns|igned sh|
|00001640| 6f 72 74 20 64 73 74 42 | 6c 6b 73 50 65 72 41 6c |ort dstB|lksPerAl|
|00001650| 6c 6f 63 42 6c 6b 3b 0d | 09 75 6e 73 69 67 6e 65 |locBlk;.|.unsigne|
|00001660| 64 20 73 68 6f 72 74 20 | 73 72 63 44 61 74 61 42 |d short |srcDataB|
|00001670| 6c 6b 73 3b 0d 09 75 6e | 73 69 67 6e 65 64 20 73 |lks;..un|signed s|
|00001680| 68 6f 72 74 20 73 72 63 | 52 65 73 6f 75 72 63 65 |hort src|Resource|
|00001690| 42 6c 6b 73 3b 0d 09 0d | 09 2f 2a 20 47 65 74 20 |Blks;...|./* Get |
|000016a0| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 35 31 |the numb|er of 51|
|000016b0| 32 20 62 79 74 65 20 62 | 6c 6f 63 6b 73 20 70 65 |2 byte b|locks pe|
|000016c0| 72 20 61 6c 6c 6f 63 61 | 74 69 6f 6e 20 62 6c 6f |r alloca|tion blo|
|000016d0| 63 6b 20 61 6e 64 20 2a | 2f 0d 09 2f 2a 20 6e 75 |ck and *|/../* nu|
|000016e0| 6d 62 65 72 20 6f 66 20 | 66 72 65 65 20 61 6c 6c |mber of |free all|
|000016f0| 6f 63 61 74 69 6f 6e 20 | 62 6c 6f 63 6b 73 20 6f |ocation |blocks o|
|00001700| 6e 20 74 68 65 20 64 65 | 73 74 69 6e 61 74 69 6f |n the de|stinatio|
|00001710| 6e 20 76 6f 6c 75 6d 65 | 20 2a 2f 0d 09 70 62 2e |n volume| */..pb.|
|00001720| 76 6f 6c 75 6d 65 50 61 | 72 61 6d 2e 69 6f 56 52 |volumePa|ram.ioVR|
|00001730| 65 66 4e 75 6d 20 3d 20 | 64 73 74 56 52 65 66 4e |efNum = |dstVRefN|
|00001740| 75 6d 3b 0d 09 69 66 20 | 28 20 64 73 74 56 6f 6c |um;..if |( dstVol|
|00001750| 4e 61 6d 65 20 3d 3d 20 | 4e 55 4c 4c 20 29 0d 09 |Name == |NULL )..|
|00001760| 7b 0d 09 09 70 62 2e 76 | 6f 6c 75 6d 65 50 61 72 |{...pb.v|olumePar|
|00001770| 61 6d 2e 69 6f 4e 61 6d | 65 50 74 72 20 3d 20 4e |am.ioNam|ePtr = N|
|00001780| 55 4c 4c 3b 0d 09 09 70 | 62 2e 76 6f 6c 75 6d 65 |ULL;...p|b.volume|
|00001790| 50 61 72 61 6d 2e 69 6f | 56 6f 6c 49 6e 64 65 78 |Param.io|VolIndex|
|000017a0| 20 3d 20 30 3b 09 09 2f | 2a 20 75 73 65 20 69 6f | = 0;../|* use io|
|000017b0| 56 52 65 66 4e 75 6d 20 | 6f 6e 6c 79 20 2a 2f 0d |VRefNum |only */.|
|000017c0| 09 7d 0d 09 65 6c 73 65 | 0d 09 7b 0d 09 09 42 6c |.}..else|..{...Bl|
|000017d0| 6f 63 6b 4d 6f 76 65 44 | 61 74 61 28 64 73 74 56 |ockMoveD|ata(dstV|
|000017e0| 6f 6c 4e 61 6d 65 2c 20 | 74 65 6d 70 50 61 74 68 |olName, |tempPath|
|000017f0| 6e 61 6d 65 2c 20 64 73 | 74 56 6f 6c 4e 61 6d 65 |name, ds|tVolName|
|00001800| 5b 30 5d 20 2b 20 31 29 | 3b 09 2f 2a 20 6d 61 6b |[0] + 1)|;./* mak|
|00001810| 65 20 61 20 63 6f 70 79 | 20 6f 66 20 74 68 65 20 |e a copy| of the |
|00001820| 73 74 72 69 6e 67 20 61 | 6e 64 20 2a 2f 0d 09 09 |string a|nd */...|
|00001830| 70 62 2e 76 6f 6c 75 6d | 65 50 61 72 61 6d 2e 69 |pb.volum|eParam.i|
|00001840| 6f 4e 61 6d 65 50 74 72 | 20 3d 20 28 53 74 72 69 |oNamePtr| = (Stri|
|00001850| 6e 67 50 74 72 29 74 65 | 6d 70 50 61 74 68 6e 61 |ngPtr)te|mpPathna|
|00001860| 6d 65 3b 09 2f 2a 20 75 | 73 65 20 74 68 65 20 63 |me;./* u|se the c|
|00001870| 6f 70 79 20 73 6f 20 6f | 72 69 67 69 6e 61 6c 20 |opy so o|riginal |
|00001880| 69 73 6e 27 74 20 74 72 | 61 73 68 65 64 20 2a 2f |isn't tr|ashed */|
|00001890| 0d 09 09 70 62 2e 76 6f | 6c 75 6d 65 50 61 72 61 |...pb.vo|lumePara|
|000018a0| 6d 2e 69 6f 56 6f 6c 49 | 6e 64 65 78 20 3d 20 2d |m.ioVolI|ndex = -|
|000018b0| 31 3b 09 2f 2a 20 75 73 | 65 20 69 6f 4e 61 6d 65 |1;./* us|e ioName|
|000018c0| 50 74 72 2f 69 6f 56 52 | 65 66 4e 75 6d 20 63 6f |Ptr/ioVR|efNum co|
|000018d0| 6d 62 69 6e 61 74 69 6f | 6e 20 2a 2f 0d 09 7d 0d |mbinatio|n */..}.|
|000018e0| 09 65 72 72 6f 72 20 3d | 20 50 42 48 47 65 74 56 |.error =| PBHGetV|
|000018f0| 49 6e 66 6f 53 79 6e 63 | 28 26 70 62 29 3b 0d 09 |InfoSync|(&pb);..|
|00001900| 69 66 20 28 20 65 72 72 | 6f 72 20 3d 3d 20 6e 6f |if ( err|or == no|
|00001910| 45 72 72 20 29 0d 09 7b | 0d 09 09 2f 2a 20 67 65 |Err )..{|.../* ge|
|00001920| 74 20 61 6c 6c 6f 63 61 | 74 69 6f 6e 20 62 6c 6f |t alloca|tion blo|
|00001930| 63 6b 20 73 69 7a 65 20 | 28 61 6c 77 61 79 73 20 |ck size |(always |
|00001940| 6d 75 6c 74 69 70 6c 65 | 20 6f 66 20 35 31 32 29 |multiple| of 512)|
|00001950| 20 61 6e 64 20 64 69 76 | 69 64 65 20 62 79 20 35 | and div|ide by 5|
|00001960| 31 32 0d 09 09 20 20 74 | 6f 20 67 65 74 20 6e 75 |12... t|o get nu|
|00001970| 6d 62 65 72 20 6f 66 20 | 35 31 32 2d 62 79 74 65 |mber of |512-byte|
|00001980| 20 62 6c 6f 63 6b 73 20 | 70 65 72 20 61 6c 6c 6f | blocks |per allo|
|00001990| 63 61 74 69 6f 6e 20 62 | 6c 6f 63 6b 20 2a 2f 0d |cation b|lock */.|
|000019a0| 09 09 64 73 74 42 6c 6b | 73 50 65 72 41 6c 6c 6f |..dstBlk|sPerAllo|
|000019b0| 63 42 6c 6b 20 3d 20 28 | 28 75 6e 73 69 67 6e 65 |cBlk = (|(unsigne|
|000019c0| 64 20 6c 6f 6e 67 29 70 | 62 2e 76 6f 6c 75 6d 65 |d long)p|b.volume|
|000019d0| 50 61 72 61 6d 2e 69 6f | 56 41 6c 42 6c 6b 53 69 |Param.io|VAlBlkSi|
|000019e0| 7a 20 3e 3e 20 39 29 3b | 0d 09 09 64 73 74 46 72 |z >> 9);|...dstFr|
|000019f0| 65 65 42 6c 6f 63 6b 73 | 20 3d 20 28 75 6e 73 69 |eeBlocks| = (unsi|
|00001a00| 67 6e 65 64 20 73 68 6f | 72 74 29 70 62 2e 76 6f |gned sho|rt)pb.vo|
|00001a10| 6c 75 6d 65 50 61 72 61 | 6d 2e 69 6f 56 46 72 42 |lumePara|m.ioVFrB|
|00001a20| 6c 6b 3b 0d 09 09 0d 09 | 09 2f 2a 20 4e 6f 77 2c |lk;.....|./* Now,|
|00001a30| 20 67 65 74 20 74 68 65 | 20 73 69 7a 65 20 6f 66 | get the| size of|
|00001a40| 20 74 68 65 20 66 69 6c | 65 27 73 20 64 61 74 61 | the fil|e's data|
|00001a50| 20 72 65 73 6f 75 72 63 | 65 20 66 6f 72 6b 73 20 | resourc|e forks |
|00001a60| 2a 2f 0d 09 09 70 62 2e | 66 69 6c 65 50 61 72 61 |*/...pb.|filePara|
|00001a70| 6d 2e 69 6f 4e 61 6d 65 | 50 74 72 20 3d 20 28 53 |m.ioName|Ptr = (S|
|00001a80| 74 72 69 6e 67 50 74 72 | 29 73 72 63 4e 61 6d 65 |tringPtr|)srcName|
|00001a90| 3b 0d 09 09 70 62 2e 66 | 69 6c 65 50 61 72 61 6d |;...pb.f|ileParam|
|00001aa0| 2e 69 6f 56 52 65 66 4e | 75 6d 20 3d 20 73 72 63 |.ioVRefN|um = src|
|00001ab0| 56 52 65 66 4e 75 6d 3b | 0d 09 09 70 62 2e 66 69 |VRefNum;|...pb.fi|
|00001ac0| 6c 65 50 61 72 61 6d 2e | 69 6f 46 56 65 72 73 4e |leParam.|ioFVersN|
|00001ad0| 75 6d 20 3d 20 30 3b 0d | 09 09 70 62 2e 66 69 6c |um = 0;.|..pb.fil|
|00001ae0| 65 50 61 72 61 6d 2e 69 | 6f 44 69 72 49 44 20 3d |eParam.i|oDirID =|
|00001af0| 20 73 72 63 44 69 72 49 | 44 3b 0d 09 09 70 62 2e | srcDirI|D;...pb.|
|00001b00| 66 69 6c 65 50 61 72 61 | 6d 2e 69 6f 46 44 69 72 |filePara|m.ioFDir|
|00001b10| 49 6e 64 65 78 20 3d 20 | 30 3b 0d 09 09 65 72 72 |Index = |0;...err|
|00001b20| 6f 72 20 3d 20 50 42 48 | 47 65 74 46 49 6e 66 6f |or = PBH|GetFInfo|
|00001b30| 53 79 6e 63 28 26 70 62 | 29 3b 0d 09 09 69 66 20 |Sync(&pb|);...if |
|00001b40| 28 20 65 72 72 6f 72 20 | 3d 3d 20 6e 6f 45 72 72 |( error |== noErr|
|00001b50| 20 29 0d 09 09 7b 0d 09 | 09 09 2f 2a 20 67 65 74 | )...{..|../* get|
|00001b60| 20 6e 75 6d 62 65 72 20 | 6f 66 20 35 31 32 2d 62 | number |of 512-b|
|00001b70| 79 74 65 20 62 6c 6f 63 | 6b 73 20 6e 65 65 64 65 |yte bloc|ks neede|
|00001b80| 64 20 66 6f 72 20 64 61 | 74 61 20 66 6f 72 6b 20 |d for da|ta fork |
|00001b90| 2a 2f 0d 09 09 09 73 72 | 63 44 61 74 61 42 6c 6b |*/....sr|cDataBlk|
|00001ba0| 73 20 3d 20 28 28 75 6e | 73 69 67 6e 65 64 20 6c |s = ((un|signed l|
|00001bb0| 6f 6e 67 29 70 62 2e 66 | 69 6c 65 50 61 72 61 6d |ong)pb.f|ileParam|
|00001bc0| 2e 69 6f 46 6c 4c 67 4c | 65 6e 20 25 20 35 31 32 |.ioFlLgL|en % 512|
|00001bd0| 29 20 3f 0d 09 09 09 09 | 09 09 20 20 28 28 28 75 |) ?.....|.. (((u|
|00001be0| 6e 73 69 67 6e 65 64 20 | 6c 6f 6e 67 29 70 62 2e |nsigned |long)pb.|
|00001bf0| 66 69 6c 65 50 61 72 61 | 6d 2e 69 6f 46 6c 4c 67 |filePara|m.ioFlLg|
|00001c00| 4c 65 6e 20 3e 3e 20 39 | 29 20 2b 20 31 29 20 3a |Len >> 9|) + 1) :|
|00001c10| 0d 09 09 09 09 09 09 20 | 20 28 28 75 6e 73 69 67 |....... | ((unsig|
|00001c20| 6e 65 64 20 6c 6f 6e 67 | 29 70 62 2e 66 69 6c 65 |ned long|)pb.file|
|00001c30| 50 61 72 61 6d 2e 69 6f | 46 6c 4c 67 4c 65 6e 20 |Param.io|FlLgLen |
|00001c40| 3e 3e 20 39 29 3b 0d 09 | 09 09 2f 2a 20 6e 6f 77 |>> 9);..|../* now|
|00001c50| 2c 20 63 61 6c 63 75 6c | 61 74 65 20 6e 75 6d 62 |, calcul|ate numb|
|00001c60| 65 72 20 6f 66 20 6e 65 | 77 20 61 6c 6c 6f 63 61 |er of ne|w alloca|
|00001c70| 74 69 6f 6e 20 62 6c 6f | 63 6b 73 20 6e 65 65 64 |tion blo|cks need|
|00001c80| 65 64 20 2a 2f 0d 09 09 | 09 73 72 63 44 61 74 61 |ed */...|.srcData|
|00001c90| 42 6c 6b 73 20 3d 20 28 | 73 72 63 44 61 74 61 42 |Blks = (|srcDataB|
|00001ca0| 6c 6b 73 20 25 20 64 73 | 74 42 6c 6b 73 50 65 72 |lks % ds|tBlksPer|
|00001cb0| 41 6c 6c 6f 63 42 6c 6b | 29 20 3f 0d 09 09 09 09 |AllocBlk|) ?.....|
|00001cc0| 09 09 20 20 28 28 73 72 | 63 44 61 74 61 42 6c 6b |.. ((sr|cDataBlk|
|00001cd0| 73 20 2f 20 64 73 74 42 | 6c 6b 73 50 65 72 41 6c |s / dstB|lksPerAl|
|00001ce0| 6c 6f 63 42 6c 6b 29 20 | 2b 20 31 29 20 3a 0d 09 |locBlk) |+ 1) :..|
|00001cf0| 09 09 09 09 09 20 20 28 | 73 72 63 44 61 74 61 42 |..... (|srcDataB|
|00001d00| 6c 6b 73 20 2f 20 64 73 | 74 42 6c 6b 73 50 65 72 |lks / ds|tBlksPer|
|00001d10| 41 6c 6c 6f 63 42 6c 6b | 29 3b 0d 09 09 0d 09 09 |AllocBlk|);......|
|00001d20| 09 2f 2a 20 67 65 74 20 | 6e 75 6d 62 65 72 20 6f |./* get |number o|
|00001d30| 66 20 35 31 32 2d 62 79 | 74 65 20 62 6c 6f 63 6b |f 512-by|te block|
|00001d40| 73 20 6e 65 65 64 65 64 | 20 66 6f 72 20 72 65 73 |s needed| for res|
|00001d50| 6f 75 72 63 65 20 66 6f | 72 6b 20 2a 2f 0d 09 09 |ource fo|rk */...|
|00001d60| 09 73 72 63 52 65 73 6f | 75 72 63 65 42 6c 6b 73 |.srcReso|urceBlks|
|00001d70| 20 3d 20 28 28 75 6e 73 | 69 67 6e 65 64 20 6c 6f | = ((uns|igned lo|
|00001d80| 6e 67 29 70 62 2e 66 69 | 6c 65 50 61 72 61 6d 2e |ng)pb.fi|leParam.|
|00001d90| 69 6f 46 6c 52 4c 67 4c | 65 6e 20 25 20 35 31 32 |ioFlRLgL|en % 512|
|00001da0| 29 20 3f 0d 09 09 09 09 | 09 09 09 20 20 28 28 28 |) ?.....|... (((|
|00001db0| 75 6e 73 69 67 6e 65 64 | 20 6c 6f 6e 67 29 70 62 |unsigned| long)pb|
|00001dc0| 2e 66 69 6c 65 50 61 72 | 61 6d 2e 69 6f 46 6c 52 |.filePar|am.ioFlR|
|00001dd0| 4c 67 4c 65 6e 20 3e 3e | 20 39 29 20 2b 20 31 29 |LgLen >>| 9) + 1)|
|00001de0| 20 3a 0d 09 09 09 09 09 | 09 09 20 20 28 28 75 6e | :......|.. ((un|
|00001df0| 73 69 67 6e 65 64 20 6c | 6f 6e 67 29 70 62 2e 66 |signed l|ong)pb.f|
|00001e00| 69 6c 65 50 61 72 61 6d | 2e 69 6f 46 6c 52 4c 67 |ileParam|.ioFlRLg|
|00001e10| 4c 65 6e 20 3e 3e 20 39 | 29 3b 0d 09 09 09 2f 2a |Len >> 9|);..../*|
|00001e20| 20 6e 6f 77 2c 20 63 61 | 6c 63 75 6c 61 74 65 20 | now, ca|lculate |
|00001e30| 6e 75 6d 62 65 72 20 6f | 66 20 6e 65 77 20 61 6c |number o|f new al|
|00001e40| 6c 6f 63 61 74 69 6f 6e | 20 62 6c 6f 63 6b 73 20 |location| blocks |
|00001e50| 6e 65 65 64 65 64 20 2a | 2f 0d 09 09 09 73 72 63 |needed *|/....src|
|00001e60| 52 65 73 6f 75 72 63 65 | 42 6c 6b 73 20 3d 20 28 |Resource|Blks = (|
|00001e70| 73 72 63 52 65 73 6f 75 | 72 63 65 42 6c 6b 73 20 |srcResou|rceBlks |
|00001e80| 25 20 64 73 74 42 6c 6b | 73 50 65 72 41 6c 6c 6f |% dstBlk|sPerAllo|
|00001e90| 63 42 6c 6b 29 20 3f 0d | 09 09 09 09 09 09 09 20 |cBlk) ?.|....... |
|00001ea0| 20 28 28 73 72 63 52 65 | 73 6f 75 72 63 65 42 6c | ((srcRe|sourceBl|
|00001eb0| 6b 73 20 2f 20 64 73 74 | 42 6c 6b 73 50 65 72 41 |ks / dst|BlksPerA|
|00001ec0| 6c 6c 6f 63 42 6c 6b 29 | 20 2b 20 31 29 20 3a 0d |llocBlk)| + 1) :.|
|00001ed0| 09 09 09 09 09 09 09 20 | 20 28 73 72 63 52 65 73 |....... | (srcRes|
|00001ee0| 6f 75 72 63 65 42 6c 6b | 73 20 2f 20 64 73 74 42 |ourceBlk|s / dstB|
|00001ef0| 6c 6b 73 50 65 72 41 6c | 6c 6f 63 42 6c 6b 29 3b |lksPerAl|locBlk);|
|00001f00| 0d 09 09 09 0d 09 09 09 | 2f 2a 20 49 73 20 74 68 |........|/* Is th|
|00001f10| 65 72 65 20 65 6e 6f 75 | 67 68 20 72 6f 6f 6d 20 |ere enou|gh room |
|00001f20| 6f 6e 20 74 68 65 20 64 | 65 73 74 69 6e 61 74 69 |on the d|estinati|
|00001f30| 6f 6e 20 76 6f 6c 75 6d | 65 20 66 6f 72 20 74 68 |on volum|e for th|
|00001f40| 65 20 73 6f 75 72 63 65 | 20 66 69 6c 65 3f 20 2a |e source| file? *|
|00001f50| 2f 0d 09 09 09 2a 73 70 | 61 63 65 4f 4b 20 3d 20 |/....*sp|aceOK = |
|00001f60| 28 28 73 72 63 44 61 74 | 61 42 6c 6b 73 20 2b 20 |((srcDat|aBlks + |
|00001f70| 73 72 63 52 65 73 6f 75 | 72 63 65 42 6c 6b 73 29 |srcResou|rceBlks)|
|00001f80| 20 3c 3d 20 64 73 74 46 | 72 65 65 42 6c 6f 63 6b | <= dstF|reeBlock|
|00001f90| 73 29 3b 0d 09 09 7d 0d | 09 7d 0d 09 72 65 74 75 |s);...}.|.}..retu|
|00001fa0| 72 6e 20 28 20 65 72 72 | 6f 72 20 29 3b 0d 7d 0d |rn ( err|or );.}.|
|00001fb0| 0d 2f 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |./******|********|
|00001fc0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001fd0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001fe0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001ff0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2f |********|*******/|
|00002000| 0d 0d 70 61 73 63 61 6c | 09 4f 53 45 72 72 09 46 |..pascal|.OSErr.F|
|00002010| 69 6c 65 43 6f 70 79 28 | 73 68 6f 72 74 20 73 72 |ileCopy(|short sr|
|00002020| 63 56 52 65 66 4e 75 6d | 2c 0d 09 09 09 09 09 09 |cVRefNum|,.......|
|00002030| 20 6c 6f 6e 67 20 73 72 | 63 44 69 72 49 44 2c 0d | long sr|cDirID,.|
|00002040| 09 09 09 09 09 09 20 43 | 6f 6e 73 74 53 74 72 32 |...... C|onstStr2|
|00002050| 35 35 50 61 72 61 6d 20 | 73 72 63 4e 61 6d 65 2c |55Param |srcName,|
|00002060| 0d 09 09 09 09 09 09 20 | 73 68 6f 72 74 20 64 73 |....... |short ds|
|00002070| 74 56 52 65 66 4e 75 6d | 2c 0d 09 09 09 09 09 09 |tVRefNum|,.......|
|00002080| 20 6c 6f 6e 67 20 64 73 | 74 44 69 72 49 44 2c 0d | long ds|tDirID,.|
|00002090| 09 09 09 09 09 09 20 53 | 74 72 69 6e 67 50 74 72 |...... S|tringPtr|
|000020a0| 20 64 73 74 50 61 74 68 | 6e 61 6d 65 2c 0d 09 09 | dstPath|name,...|
|000020b0| 09 09 09 09 20 53 74 72 | 69 6e 67 50 74 72 20 63 |.... Str|ingPtr c|
|000020c0| 6f 70 79 4e 61 6d 65 2c | 0d 09 09 09 09 09 09 20 |opyName,|....... |
|000020d0| 50 74 72 20 63 6f 70 79 | 42 75 66 66 65 72 50 74 |Ptr copy|BufferPt|
|000020e0| 72 2c 0d 09 09 09 09 09 | 09 20 6c 6f 6e 67 20 63 |r,......|. long c|
|000020f0| 6f 70 79 42 75 66 66 65 | 72 53 69 7a 65 2c 0d 09 |opyBuffe|rSize,..|
|00002100| 09 09 09 09 09 20 42 6f | 6f 6c 65 61 6e 20 70 72 |..... Bo|olean pr|
|00002110| 65 66 6c 69 67 68 74 29 | 0d 7b 0d 09 4f 53 45 72 |eflight)|.{..OSEr|
|00002120| 72 09 65 72 72 3b 0d 0d | 09 73 68 6f 72 74 09 73 |r.err;..|.short.s|
|00002130| 72 63 52 65 66 4e 75 6d | 20 3d 20 30 2c 09 09 09 |rcRefNum| = 0,...|
|00002140| 2f 2a 20 30 20 77 68 65 | 6e 20 73 6f 75 72 63 65 |/* 0 whe|n source|
|00002150| 20 64 61 74 61 20 61 6e | 64 20 72 65 73 6f 75 72 | data an|d resour|
|00002160| 63 65 20 66 6f 72 6b 20 | 61 72 65 20 63 6c 6f 73 |ce fork |are clos|
|00002170| 65 64 20 20 2a 2f 0d 09 | 09 09 64 73 74 44 61 74 |ed */..|..dstDat|
|00002180| 61 52 65 66 4e 75 6d 20 | 3d 20 30 2c 09 09 2f 2a |aRefNum |= 0,../*|
|00002190| 20 30 20 77 68 65 6e 20 | 64 65 73 74 69 6e 61 74 | 0 when |destinat|
|000021a0| 69 6f 6e 20 64 61 74 61 | 20 66 6f 72 6b 20 69 73 |ion data| fork is|
|000021b0| 20 63 6c 6f 73 65 64 20 | 2a 2f 0d 09 09 09 64 73 | closed |*/....ds|
|000021c0| 74 52 73 72 63 52 65 66 | 4e 75 6d 20 3d 20 30 3b |tRsrcRef|Num = 0;|
|000021d0| 09 09 2f 2a 20 30 20 77 | 68 65 6e 20 64 65 73 74 |../* 0 w|hen dest|
|000021e0| 69 6e 61 74 69 6f 6e 20 | 72 65 73 6f 75 72 63 65 |ination |resource|
|000021f0| 20 66 6f 72 6b 20 69 73 | 20 63 6c 6f 73 65 64 20 | fork is| closed |
|00002200| 2a 2f 0d 09 0d 09 53 74 | 72 36 33 09 64 73 74 4e |*/....St|r63.dstN|
|00002210| 61 6d 65 3b 09 09 09 09 | 2f 2a 20 54 68 65 20 66 |ame;....|/* The f|
|00002220| 69 6c 65 6e 61 6d 65 20 | 6f 66 20 74 68 65 20 64 |ilename |of the d|
|00002230| 65 73 74 69 6e 61 74 69 | 6f 6e 2e 20 49 74 20 6d |estinati|on. It m|
|00002240| 69 67 68 74 20 62 65 20 | 74 68 65 0d 09 09 09 09 |ight be |the.....|
|00002250| 09 09 09 09 09 2a 2a 20 | 73 6f 75 72 63 65 20 66 |.....** |source f|
|00002260| 69 6c 65 6e 61 6d 65 2c | 20 69 74 20 6d 69 67 68 |ilename,| it migh|
|00002270| 74 20 62 65 20 61 20 6e | 65 77 20 6e 61 6d 65 2e |t be a n|ew name.|
|00002280| 2e 2e 20 2a 2f 0d 09 0d | 09 47 65 74 56 6f 6c 50 |.. */...|.GetVolP|
|00002290| 61 72 6d 73 49 6e 66 6f | 42 75 66 66 65 72 20 69 |armsInfo|Buffer i|
|000022a0| 6e 66 6f 42 75 66 66 65 | 72 3b 20 2f 2a 20 57 68 |nfoBuffe|r; /* Wh|
|000022b0| 65 72 65 20 50 42 47 65 | 74 56 6f 6c 50 61 72 6d |ere PBGe|tVolParm|
|000022c0| 73 20 64 75 6d 70 73 20 | 69 74 73 20 69 6e 66 6f |s dumps |its info|
|000022d0| 20 2a 2f 0d 09 6c 6f 6e | 67 09 73 72 63 53 65 72 | */..lon|g.srcSer|
|000022e0| 76 65 72 41 64 72 3b 09 | 09 09 2f 2a 20 41 70 70 |verAdr;.|../* App|
|000022f0| 6c 65 54 61 6c 6b 20 73 | 65 72 76 65 72 20 61 64 |leTalk s|erver ad|
|00002300| 64 72 65 73 73 20 6f 66 | 20 73 6f 75 72 63 65 20 |dress of| source |
|00002310| 28 69 66 20 61 6e 79 29 | 20 2a 2f 0d 09 0d 09 42 |(if any)| */....B|
|00002320| 6f 6f 6c 65 61 6e 09 64 | 73 74 43 72 65 61 74 65 |oolean.d|stCreate|
|00002330| 64 20 3d 20 66 61 6c 73 | 65 2c 09 09 2f 2a 20 74 |d = fals|e,../* t|
|00002340| 72 75 65 20 77 68 65 6e | 20 64 65 73 74 69 6e 61 |rue when| destina|
|00002350| 74 69 6f 6e 20 66 69 6c | 65 20 68 61 73 20 62 65 |tion fil|e has be|
|00002360| 65 6e 20 63 72 65 61 74 | 65 64 20 2a 2f 0d 09 09 |en creat|ed */...|
|00002370| 09 6f 75 72 43 6f 70 79 | 42 75 66 66 65 72 20 3d |.ourCopy|Buffer =|
|00002380| 20 66 61 6c 73 65 2c 09 | 2f 2a 20 74 72 75 65 20 | false,.|/* true |
|00002390| 69 66 20 77 65 20 68 61 | 64 20 74 6f 20 61 6c 6c |if we ha|d to all|
|000023a0| 6f 63 61 74 65 20 74 68 | 65 20 63 6f 70 79 20 62 |ocate th|e copy b|
|000023b0| 75 66 66 65 72 20 2a 2f | 0d 09 09 09 69 73 44 69 |uffer */|....isDi|
|000023c0| 72 65 63 74 6f 72 79 2c | 09 09 09 2f 2a 20 74 72 |rectory,|.../* tr|
|000023d0| 75 65 20 69 66 20 64 65 | 73 74 69 6e 61 74 69 6f |ue if de|stinatio|
|000023e0| 6e 20 69 73 20 72 65 61 | 6c 6c 79 20 61 20 64 69 |n is rea|lly a di|
|000023f0| 72 65 63 74 6f 72 79 20 | 2a 2f 0d 09 09 09 69 73 |rectory |*/....is|
|00002400| 44 72 6f 70 42 6f 78 3b | 09 09 09 09 2f 2a 20 74 |DropBox;|..../* t|
|00002410| 72 75 65 20 69 66 20 64 | 65 73 74 69 6e 61 74 69 |rue if d|estinati|
|00002420| 6f 6e 20 69 73 20 61 6e | 20 41 70 70 6c 65 53 68 |on is an| AppleSh|
|00002430| 61 72 65 20 64 72 6f 70 | 20 62 6f 78 20 2a 2f 0d |are drop| box */.|
|00002440| 09 0d 09 6c 6f 6e 67 09 | 74 65 6d 70 4c 6f 6e 67 |...long.|tempLong|
|00002450| 3b 0d 09 73 68 6f 72 74 | 09 74 65 6d 70 49 6e 74 |;..short|.tempInt|
|00002460| 3b 0d 09 0d 09 42 6f 6f | 6c 65 61 6e 09 73 70 61 |;....Boo|lean.spa|
|00002470| 63 65 4f 4b 3b 09 09 09 | 09 2f 2a 20 74 72 75 65 |ceOK;...|./* true|
|00002480| 20 69 66 20 74 68 65 72 | 65 27 73 20 65 6e 6f 75 | if ther|e's enou|
|00002490| 67 68 20 72 6f 6f 6d 20 | 74 6f 20 63 6f 70 79 20 |gh room |to copy |
|000024a0| 74 68 65 20 66 69 6c 65 | 20 74 6f 20 74 68 65 20 |the file| to the |
|000024b0| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 76 6f 6c 75 |destinat|ion volu|
|000024c0| 6d 65 20 2a 2f 0d 0d 09 | 42 6f 6f 6c 65 61 6e 09 |me */...|Boolean.|
|000024d0| 68 61 73 44 61 74 61 46 | 6f 72 6b 3b 0d 09 42 6f |hasDataF|ork;..Bo|
|000024e0| 6f 6c 65 61 6e 09 68 61 | 73 52 65 73 6f 75 72 63 |olean.ha|sResourc|
|000024f0| 65 46 6f 72 6b 3b 0d 0d | 09 2f 2a 20 50 72 65 66 |eFork;..|./* Pref|
|00002500| 6c 69 67 68 74 20 66 6f | 72 20 73 69 7a 65 20 2a |light fo|r size *|
|00002510| 2f 0d 09 69 66 20 28 20 | 70 72 65 66 6c 69 67 68 |/..if ( |prefligh|
|00002520| 74 20 29 0d 09 7b 0d 09 | 09 65 72 72 20 3d 20 50 |t )..{..|.err = P|
|00002530| 72 65 66 6c 69 67 68 74 | 46 69 6c 65 43 6f 70 79 |reflight|FileCopy|
|00002540| 53 70 61 63 65 28 73 72 | 63 56 52 65 66 4e 75 6d |Space(sr|cVRefNum|
|00002550| 2c 20 73 72 63 44 69 72 | 49 44 2c 20 73 72 63 4e |, srcDir|ID, srcN|
|00002560| 61 6d 65 2c 0d 09 09 09 | 09 09 09 09 09 09 20 64 |ame,....|...... d|
|00002570| 73 74 50 61 74 68 6e 61 | 6d 65 2c 20 64 73 74 56 |stPathna|me, dstV|
|00002580| 52 65 66 4e 75 6d 2c 20 | 26 73 70 61 63 65 4f 4b |RefNum, |&spaceOK|
|00002590| 29 3b 0d 09 09 69 66 20 | 28 20 65 72 72 20 21 3d |);...if |( err !=|
|000025a0| 20 6e 6f 45 72 72 20 29 | 0d 09 09 09 72 65 74 75 | noErr )|....retu|
|000025b0| 72 6e 20 28 20 65 72 72 | 20 29 3b 0d 09 09 69 66 |rn ( err| );...if|
|000025c0| 20 28 20 21 73 70 61 63 | 65 4f 4b 20 29 0d 09 09 | ( !spac|eOK )...|
|000025d0| 09 72 65 74 75 72 6e 20 | 28 20 64 73 6b 46 75 6c |.return |( dskFul|
|000025e0| 45 72 72 20 29 3b 0d 09 | 7d 0d 0d 09 2f 2a 20 67 |Err );..|}.../* g|
|000025f0| 65 74 20 74 68 65 20 64 | 65 73 74 69 6e 61 74 69 |et the d|estinati|
|00002600| 6f 6e 27 73 20 72 65 61 | 6c 20 64 69 72 49 44 20 |on's rea|l dirID |
|00002610| 61 6e 64 20 6d 61 6b 65 | 20 73 75 72 65 20 69 74 |and make| sure it|
|00002620| 20 72 65 61 6c 6c 79 20 | 69 73 20 61 20 64 69 72 | really |is a dir|
|00002630| 65 63 74 6f 72 79 20 2a | 2f 0d 09 65 72 72 20 3d |ectory *|/..err =|
|00002640| 20 47 65 74 44 65 73 74 | 69 6e 61 74 69 6f 6e 44 | GetDest|inationD|
|00002650| 69 72 49 6e 66 6f 28 64 | 73 74 56 52 65 66 4e 75 |irInfo(d|stVRefNu|
|00002660| 6d 2c 20 64 73 74 44 69 | 72 49 44 2c 20 64 73 74 |m, dstDi|rID, dst|
|00002670| 50 61 74 68 6e 61 6d 65 | 2c 0d 09 09 09 09 09 09 |Pathname|,.......|
|00002680| 09 09 26 64 73 74 44 69 | 72 49 44 2c 20 26 69 73 |..&dstDi|rID, &is|
|00002690| 44 69 72 65 63 74 6f 72 | 79 2c 20 26 69 73 44 72 |Director|y, &isDr|
|000026a0| 6f 70 42 6f 78 29 3b 0d | 09 69 66 20 28 20 65 72 |opBox);.|.if ( er|
|000026b0| 72 20 21 3d 20 6e 6f 45 | 72 72 20 29 0d 09 09 67 |r != noE|rr )...g|
|000026c0| 6f 74 6f 20 45 72 72 6f | 72 45 78 69 74 3b 0d 09 |oto Erro|rExit;..|
|000026d0| 69 66 20 28 20 21 69 73 | 44 69 72 65 63 74 6f 72 |if ( !is|Director|
|000026e0| 79 20 29 0d 09 09 72 65 | 74 75 72 6e 20 28 20 64 |y )...re|turn ( d|
|000026f0| 69 72 4e 46 45 72 72 20 | 29 3b 0d 0d 09 2f 2a 20 |irNFErr |);.../* |
|00002700| 67 65 74 20 74 68 65 20 | 64 65 73 74 69 6e 61 74 |get the |destinat|
|00002710| 69 6f 6e 27 73 20 72 65 | 61 6c 20 76 52 65 66 4e |ion's re|al vRefN|
|00002720| 75 6d 20 2a 2f 0d 09 65 | 72 72 20 3d 20 44 65 74 |um */..e|rr = Det|
|00002730| 65 72 6d 69 6e 65 56 52 | 65 66 4e 75 6d 28 64 73 |ermineVR|efNum(ds|
|00002740| 74 50 61 74 68 6e 61 6d | 65 2c 20 64 73 74 56 52 |tPathnam|e, dstVR|
|00002750| 65 66 4e 75 6d 2c 20 26 | 64 73 74 56 52 65 66 4e |efNum, &|dstVRefN|
|00002760| 75 6d 29 3b 0d 09 69 66 | 20 28 20 65 72 72 20 21 |um);..if| ( err !|
|00002770| 3d 20 6e 6f 45 72 72 20 | 29 0d 09 09 67 6f 74 6f |= noErr |)...goto|
|00002780| 20 45 72 72 6f 72 45 78 | 69 74 3b 0d 09 0d 09 2f | ErrorEx|it;..../|
|00002790| 2a 20 53 65 65 20 69 66 | 20 50 42 48 43 6f 70 79 |* See if| PBHCopy|
|000027a0| 46 69 6c 65 20 63 61 6e | 20 62 65 20 75 73 65 64 |File can| be used|
|000027b0| 2e 20 20 55 73 69 6e 67 | 20 50 42 48 43 6f 70 79 |. Using| PBHCopy|
|000027c0| 46 69 6c 65 20 73 61 76 | 65 73 20 74 69 6d 65 20 |File sav|es time |
|000027d0| 62 79 20 6c 65 74 74 69 | 6e 67 20 74 68 65 20 66 |by letti|ng the f|
|000027e0| 69 6c 65 20 73 65 72 76 | 65 72 0d 09 2a 2a 20 63 |ile serv|er..** c|
|000027f0| 6f 70 79 20 74 68 65 20 | 66 69 6c 65 20 69 66 20 |opy the |file if |
|00002800| 74 68 65 20 73 6f 75 72 | 63 65 20 61 6e 64 20 64 |the sour|ce and d|
|00002810| 65 73 74 69 6e 61 74 69 | 6f 6e 20 6c 6f 63 61 74 |estinati|on locat|
|00002820| 69 6f 6e 73 20 61 72 65 | 20 6f 6e 20 74 68 65 20 |ions are| on the |
|00002830| 73 61 6d 65 20 66 69 6c | 65 20 73 65 72 76 65 72 |same fil|e server|
|00002840| 2e 20 2a 2f 0d 09 74 65 | 6d 70 4c 6f 6e 67 20 3d |. */..te|mpLong =|
|00002850| 20 73 69 7a 65 6f 66 28 | 69 6e 66 6f 42 75 66 66 | sizeof(|infoBuff|
|00002860| 65 72 29 3b 0d 09 65 72 | 72 20 3d 20 48 47 65 74 |er);..er|r = HGet|
|00002870| 56 6f 6c 50 61 72 6d 73 | 28 28 53 74 72 69 6e 67 |VolParms|((String|
|00002880| 50 74 72 29 73 72 63 4e | 61 6d 65 2c 20 73 72 63 |Ptr)srcN|ame, src|
|00002890| 56 52 65 66 4e 75 6d 2c | 20 26 69 6e 66 6f 42 75 |VRefNum,| &infoBu|
|000028a0| 66 66 65 72 2c 20 26 74 | 65 6d 70 4c 6f 6e 67 29 |ffer, &t|empLong)|
|000028b0| 3b 0d 09 69 66 20 28 20 | 28 65 72 72 20 21 3d 20 |;..if ( |(err != |
|000028c0| 6e 6f 45 72 72 29 20 26 | 26 20 28 65 72 72 20 21 |noErr) &|& (err !|
|000028d0| 3d 20 70 61 72 61 6d 45 | 72 72 29 20 29 0d 09 09 |= paramE|rr) )...|
|000028e0| 72 65 74 75 72 6e 20 28 | 20 65 72 72 20 29 3b 0d |return (| err );.|
|000028f0| 0d 09 69 66 20 28 20 28 | 65 72 72 20 21 3d 20 70 |..if ( (|err != p|
|00002900| 61 72 61 6d 45 72 72 29 | 20 26 26 20 68 61 73 43 |aramErr)| && hasC|
|00002910| 6f 70 79 46 69 6c 65 28 | 69 6e 66 6f 42 75 66 66 |opyFile(|infoBuff|
|00002920| 65 72 29 20 29 0d 09 7b | 0d 09 09 2f 2a 20 54 68 |er) )..{|.../* Th|
|00002930| 65 20 73 6f 75 72 63 65 | 20 76 6f 6c 75 6d 65 20 |e source| volume |
|00002940| 73 75 70 70 6f 72 74 73 | 20 50 42 48 43 6f 70 79 |supports| PBHCopy|
|00002950| 46 69 6c 65 2e 20 2a 2f | 0d 09 09 73 72 63 53 65 |File. */|...srcSe|
|00002960| 72 76 65 72 41 64 72 20 | 3d 20 69 6e 66 6f 42 75 |rverAdr |= infoBu|
|00002970| 66 66 65 72 2e 76 4d 53 | 65 72 76 65 72 41 64 72 |ffer.vMS|erverAdr|
|00002980| 3b 0d 0d 09 09 2f 2a 20 | 4e 6f 77 2c 20 73 65 65 |;..../* |Now, see|
|00002990| 20 69 66 20 74 68 65 20 | 64 65 73 74 69 6e 61 74 | if the |destinat|
|000029a0| 69 6f 6e 20 76 6f 6c 75 | 6d 65 20 69 73 20 6f 6e |ion volu|me is on|
|000029b0| 20 74 68 65 20 73 61 6d | 65 20 66 69 6c 65 20 73 | the sam|e file s|
|000029c0| 65 72 76 65 72 2e 20 2a | 2f 0d 09 09 74 65 6d 70 |erver. *|/...temp|
|000029d0| 4c 6f 6e 67 20 3d 20 73 | 69 7a 65 6f 66 28 69 6e |Long = s|izeof(in|
|000029e0| 66 6f 42 75 66 66 65 72 | 29 3b 0d 09 09 65 72 72 |foBuffer|);...err|
|000029f0| 20 3d 20 48 47 65 74 56 | 6f 6c 50 61 72 6d 73 28 | = HGetV|olParms(|
|00002a00| 4e 55 4c 4c 2c 20 64 73 | 74 56 52 65 66 4e 75 6d |NULL, ds|tVRefNum|
|00002a10| 2c 20 26 69 6e 66 6f 42 | 75 66 66 65 72 2c 20 26 |, &infoB|uffer, &|
|00002a20| 74 65 6d 70 4c 6f 6e 67 | 29 3b 0d 09 09 69 66 20 |tempLong|);...if |
|00002a30| 28 20 28 65 72 72 20 21 | 3d 20 6e 6f 45 72 72 29 |( (err !|= noErr)|
|00002a40| 20 26 26 20 28 65 72 72 | 20 21 3d 20 70 61 72 61 | && (err| != para|
|00002a50| 6d 45 72 72 29 20 29 0d | 09 09 09 72 65 74 75 72 |mErr) ).|...retur|
|00002a60| 6e 20 28 20 65 72 72 20 | 29 3b 0d 09 09 69 66 20 |n ( err |);...if |
|00002a70| 28 20 28 65 72 72 20 21 | 3d 20 70 61 72 61 6d 45 |( (err !|= paramE|
|00002a80| 72 72 29 20 26 26 20 28 | 73 72 63 53 65 72 76 65 |rr) && (|srcServe|
|00002a90| 72 41 64 72 20 3d 3d 20 | 69 6e 66 6f 42 75 66 66 |rAdr == |infoBuff|
|00002aa0| 65 72 2e 76 4d 53 65 72 | 76 65 72 41 64 72 29 20 |er.vMSer|verAdr) |
|00002ab0| 29 0d 09 09 7b 0d 09 09 | 09 2f 2a 20 53 6f 75 72 |)...{...|./* Sour|
|00002ac0| 63 65 20 61 6e 64 20 44 | 65 73 74 20 61 72 65 20 |ce and D|est are |
|00002ad0| 6f 6e 20 73 61 6d 65 20 | 73 65 72 76 65 72 20 61 |on same |server a|
|00002ae0| 6e 64 20 50 42 48 43 6f | 70 79 46 69 6c 65 20 69 |nd PBHCo|pyFile i|
|00002af0| 73 20 73 75 70 70 6f 72 | 74 65 64 2e 20 43 6f 70 |s suppor|ted. Cop|
|00002b00| 79 20 77 69 74 68 20 43 | 6f 70 79 46 69 6c 65 2e |y with C|opyFile.|
|00002b10| 20 2a 2f 0d 09 09 09 65 | 72 72 20 3d 20 48 43 6f | */....e|rr = HCo|
|00002b20| 70 79 46 69 6c 65 28 73 | 72 63 56 52 65 66 4e 75 |pyFile(s|rcVRefNu|
|00002b30| 6d 2c 20 73 72 63 44 69 | 72 49 44 2c 20 73 72 63 |m, srcDi|rID, src|
|00002b40| 4e 61 6d 65 2c 20 64 73 | 74 56 52 65 66 4e 75 6d |Name, ds|tVRefNum|
|00002b50| 2c 20 64 73 74 44 69 72 | 49 44 2c 20 4e 55 4c 4c |, dstDir|ID, NULL|
|00002b60| 2c 20 63 6f 70 79 4e 61 | 6d 65 29 3b 0d 09 09 09 |, copyNa|me);....|
|00002b70| 69 66 20 28 20 65 72 72 | 20 21 3d 20 6e 6f 45 72 |if ( err| != noEr|
|00002b80| 72 20 29 0d 09 09 09 09 | 67 6f 74 6f 20 45 72 72 |r ).....|goto Err|
|00002b90| 6f 72 45 78 69 74 3b 0d | 09 09 09 2f 2a 20 41 70 |orExit;.|.../* Ap|
|00002ba0| 70 6c 65 53 68 61 72 65 | 27 73 20 43 6f 70 79 46 |pleShare|'s CopyF|
|00002bb0| 69 6c 65 20 63 6c 65 61 | 72 73 20 74 68 65 20 69 |ile clea|rs the i|
|00002bc0| 73 41 6c 69 61 73 20 62 | 69 74 2c 20 73 6f 20 49 |sAlias b|it, so I|
|00002bd0| 20 73 74 69 6c 6c 20 6e | 65 65 64 20 74 6f 20 61 | still n|eed to a|
|00002be0| 74 74 65 6d 70 74 20 74 | 6f 20 63 6f 70 79 0d 09 |ttempt t|o copy..|
|00002bf0| 09 09 20 20 20 74 68 65 | 20 46 69 6c 65 27 73 20 |.. the| File's |
|00002c00| 61 74 74 72 69 62 75 74 | 65 73 20 74 6f 20 61 74 |attribut|es to at|
|00002c10| 74 65 6d 70 74 20 74 6f | 20 67 65 74 20 74 68 69 |tempt to| get thi|
|00002c20| 6e 67 73 20 72 69 67 68 | 74 2e 20 2a 2f 0d 09 09 |ngs righ|t. */...|
|00002c30| 09 72 65 74 75 72 6e 20 | 28 20 43 6f 70 79 46 69 |.return |( CopyFi|
|00002c40| 6c 65 4d 67 72 41 74 74 | 72 69 62 75 74 65 73 28 |leMgrAtt|ributes(|
|00002c50| 73 72 63 56 52 65 66 4e | 75 6d 2c 20 73 72 63 44 |srcVRefN|um, srcD|
|00002c60| 69 72 49 44 2c 20 28 53 | 74 72 69 6e 67 50 74 72 |irID, (S|tringPtr|
|00002c70| 29 73 72 63 4e 61 6d 65 | 2c 0d 09 09 09 09 09 09 |)srcName|,.......|
|00002c80| 09 09 09 09 20 64 73 74 | 56 52 65 66 4e 75 6d 2c |.... dst|VRefNum,|
|00002c90| 20 64 73 74 44 69 72 49 | 44 2c 20 28 53 74 72 69 | dstDirI|D, (Stri|
|00002ca0| 6e 67 50 74 72 29 26 63 | 6f 70 79 4e 61 6d 65 2c |ngPtr)&c|opyName,|
|00002cb0| 20 74 72 75 65 29 20 29 | 3b 0d 09 09 7d 0d 09 7d | true) )|;...}..}|
|00002cc0| 0d 0d 09 2f 2a 20 49 66 | 20 77 65 27 72 65 20 68 |.../* If| we're h|
|00002cd0| 65 72 65 2c 20 74 68 65 | 6e 20 50 42 48 43 6f 70 |ere, the|n PBHCop|
|00002ce0| 79 46 69 6c 65 20 63 6f | 75 6c 64 6e 27 74 20 62 |yFile co|uldn't b|
|00002cf0| 65 20 75 73 65 64 20 73 | 6f 20 77 65 20 68 61 76 |e used s|o we hav|
|00002d00| 65 20 74 6f 20 63 6f 70 | 79 20 74 68 65 20 66 69 |e to cop|y the fi|
|00002d10| 6c 65 20 62 79 20 68 61 | 6e 64 2e 20 2a 2f 0d 0d |le by ha|nd. */..|
|00002d20| 09 2f 2a 20 4d 61 6b 65 | 20 73 75 72 65 20 61 20 |./* Make| sure a |
|00002d30| 63 6f 70 79 20 62 75 66 | 66 65 72 20 69 73 20 61 |copy buf|fer is a|
|00002d40| 6c 6c 6f 63 61 74 65 64 | 2e 20 2a 2f 0d 09 69 66 |llocated|. */..if|
|00002d50| 20 28 20 63 6f 70 79 42 | 75 66 66 65 72 50 74 72 | ( copyB|ufferPtr|
|00002d60| 20 3d 3d 20 4e 55 4c 4c | 20 29 0d 09 7b 0d 09 09 | == NULL| )..{...|
|00002d70| 2f 2a 20 54 68 65 20 63 | 61 6c 6c 65 72 20 64 69 |/* The c|aller di|
|00002d80| 64 6e 27 74 20 73 75 70 | 70 6c 79 20 61 20 63 6f |dn't sup|ply a co|
|00002d90| 70 79 20 62 75 66 66 65 | 72 20 73 6f 20 67 72 61 |py buffe|r so gra|
|00002da0| 62 20 6f 6e 65 20 66 72 | 6f 6d 20 74 68 65 20 61 |b one fr|om the a|
|00002db0| 70 70 6c 69 63 61 74 69 | 6f 6e 20 68 65 61 70 2e |pplicati|on heap.|
|00002dc0| 0d 09 09 2a 2a 20 54 72 | 79 20 74 6f 20 67 65 74 |...** Tr|y to get|
|00002dd0| 20 61 20 62 69 67 20 63 | 6f 70 79 20 62 75 66 66 | a big c|opy buff|
|00002de0| 65 72 2c 20 69 66 20 77 | 65 20 63 61 6e 27 74 2c |er, if w|e can't,|
|00002df0| 20 74 72 79 20 66 6f 72 | 20 61 20 35 31 32 2d 62 | try for| a 512-b|
|00002e00| 79 74 65 20 62 75 66 66 | 65 72 2e 0d 09 09 2a 2a |yte buff|er....**|
|00002e10| 20 49 66 20 35 31 32 20 | 62 79 74 65 73 20 61 72 | If 512 |bytes ar|
|00002e20| 65 6e 27 74 20 61 76 61 | 69 6c 61 62 6c 65 2c 20 |en't ava|ilable, |
|00002e30| 77 65 27 72 65 20 69 6e | 20 74 72 6f 75 62 6c 65 |we're in| trouble|
|00002e40| 2e 20 2a 2f 0d 09 09 63 | 6f 70 79 42 75 66 66 65 |. */...c|opyBuffe|
|00002e50| 72 53 69 7a 65 20 3d 20 | 62 69 67 43 6f 70 79 42 |rSize = |bigCopyB|
|00002e60| 75 66 66 53 69 7a 65 3b | 0d 09 09 63 6f 70 79 42 |uffSize;|...copyB|
|00002e70| 75 66 66 65 72 50 74 72 | 20 3d 20 4e 65 77 50 74 |ufferPtr| = NewPt|
|00002e80| 72 28 63 6f 70 79 42 75 | 66 66 65 72 53 69 7a 65 |r(copyBu|fferSize|
|00002e90| 29 3b 0d 09 09 69 66 20 | 28 20 63 6f 70 79 42 75 |);...if |( copyBu|
|00002ea0| 66 66 65 72 50 74 72 20 | 3d 3d 20 4e 55 4c 4c 20 |fferPtr |== NULL |
|00002eb0| 29 0d 09 09 7b 0d 09 09 | 09 63 6f 70 79 42 75 66 |)...{...|.copyBuf|
|00002ec0| 66 65 72 53 69 7a 65 20 | 3d 20 6d 69 6e 43 6f 70 |ferSize |= minCop|
|00002ed0| 79 42 75 66 66 53 69 7a | 65 3b 0d 09 09 09 63 6f |yBuffSiz|e;....co|
|00002ee0| 70 79 42 75 66 66 65 72 | 50 74 72 20 3d 20 4e 65 |pyBuffer|Ptr = Ne|
|00002ef0| 77 50 74 72 28 63 6f 70 | 79 42 75 66 66 65 72 53 |wPtr(cop|yBufferS|
|00002f00| 69 7a 65 29 3b 0d 09 09 | 09 69 66 20 28 20 63 6f |ize);...|.if ( co|
|00002f10| 70 79 42 75 66 66 65 72 | 50 74 72 20 3d 3d 20 4e |pyBuffer|Ptr == N|
|00002f20| 55 4c 4c 20 29 0d 09 09 | 09 09 72 65 74 75 72 6e |ULL )...|..return|
|00002f30| 20 28 20 6d 65 6d 46 75 | 6c 6c 45 72 72 20 29 3b | ( memFu|llErr );|
|00002f40| 0d 09 09 7d 0d 09 09 6f | 75 72 43 6f 70 79 42 75 |...}...o|urCopyBu|
|00002f50| 66 66 65 72 20 3d 20 74 | 72 75 65 3b 0d 09 7d 0d |ffer = t|rue;..}.|
|00002f60| 0d 09 2f 2a 20 4f 70 65 | 6e 20 74 68 65 20 73 6f |../* Ope|n the so|
|00002f70| 75 72 63 65 20 64 61 74 | 61 20 66 6f 72 6b 2e 20 |urce dat|a fork. |
|00002f80| 2a 2f 0d 09 65 72 72 20 | 3d 20 48 4f 70 65 6e 41 |*/..err |= HOpenA|
|00002f90| 77 61 72 65 28 73 72 63 | 56 52 65 66 4e 75 6d 2c |ware(src|VRefNum,|
|00002fa0| 20 73 72 63 44 69 72 49 | 44 2c 20 73 72 63 4e 61 | srcDirI|D, srcNa|
|00002fb0| 6d 65 2c 20 73 72 63 43 | 6f 70 79 4d 6f 64 65 2c |me, srcC|opyMode,|
|00002fc0| 20 26 73 72 63 52 65 66 | 4e 75 6d 29 3b 0d 09 69 | &srcRef|Num);..i|
|00002fd0| 66 20 28 20 65 72 72 20 | 21 3d 20 6e 6f 45 72 72 |f ( err |!= noErr|
|00002fe0| 20 29 0d 09 09 67 6f 74 | 6f 20 45 72 72 6f 72 45 | )...got|o ErrorE|
|00002ff0| 78 69 74 3b 0d 09 0d 09 | 2f 2a 20 53 65 65 20 69 |xit;....|/* See i|
|00003000| 66 20 74 68 65 20 63 6f | 70 79 20 77 69 6c 6c 20 |f the co|py will |
|00003010| 62 65 20 72 65 6e 61 6d | 65 64 2e 20 2a 2f 0d 09 |be renam|ed. */..|
|00003020| 69 66 20 28 20 63 6f 70 | 79 4e 61 6d 65 20 21 3d |if ( cop|yName !=|
|00003030| 20 4e 55 4c 4c 20 29 09 | 09 09 09 2f 2a 20 44 69 | NULL ).|.../* Di|
|00003040| 64 20 63 61 6c 6c 65 72 | 20 73 75 70 70 6c 79 20 |d caller| supply |
|00003050| 63 6f 70 79 20 66 69 6c | 65 20 6e 61 6d 65 3f 20 |copy fil|e name? |
|00003060| 2a 2f 0d 09 09 42 6c 6f | 63 6b 4d 6f 76 65 44 61 |*/...Blo|ckMoveDa|
|00003070| 74 61 28 63 6f 70 79 4e | 61 6d 65 2c 20 64 73 74 |ta(copyN|ame, dst|
|00003080| 4e 61 6d 65 2c 20 63 6f | 70 79 4e 61 6d 65 5b 30 |Name, co|pyName[0|
|00003090| 5d 20 2b 20 31 29 3b 09 | 2f 2a 20 59 65 73 2c 20 |] + 1);.|/* Yes, |
|000030a0| 75 73 65 20 74 68 65 20 | 63 61 6c 6c 65 72 20 73 |use the |caller s|
|000030b0| 75 70 70 6c 69 65 64 20 | 63 6f 70 79 20 66 69 6c |upplied |copy fil|
|000030c0| 65 20 6e 61 6d 65 2e 20 | 2a 2f 0d 09 65 6c 73 65 |e name. |*/..else|
|000030d0| 0d 09 7b 09 2f 2a 20 54 | 68 65 79 20 64 69 64 6e |..{./* T|hey didn|
|000030e0| 27 74 2c 20 73 6f 20 67 | 65 74 20 74 68 65 20 73 |'t, so g|et the s|
|000030f0| 6f 75 72 63 65 20 66 69 | 6c 65 20 6e 61 6d 65 20 |ource fi|le name |
|00003100| 61 6e 64 20 75 73 65 20 | 69 74 2e 20 2a 2f 0d 09 |and use |it. */..|
|00003110| 09 65 72 72 20 3d 20 47 | 65 74 46 69 6c 65 4c 6f |.err = G|etFileLo|
|00003120| 63 61 74 69 6f 6e 28 73 | 72 63 52 65 66 4e 75 6d |cation(s|rcRefNum|
|00003130| 2c 20 26 74 65 6d 70 49 | 6e 74 2c 20 26 74 65 6d |, &tempI|nt, &tem|
|00003140| 70 4c 6f 6e 67 2c 20 28 | 53 74 72 69 6e 67 50 74 |pLong, (|StringPt|
|00003150| 72 29 26 64 73 74 4e 61 | 6d 65 29 3b 0d 09 09 69 |r)&dstNa|me);...i|
|00003160| 66 20 28 20 65 72 72 20 | 21 3d 20 6e 6f 45 72 72 |f ( err |!= noErr|
|00003170| 20 29 0d 09 09 09 67 6f | 74 6f 20 45 72 72 6f 72 | )....go|to Error|
|00003180| 45 78 69 74 3b 0d 09 7d | 0d 0d 09 2f 2a 20 43 72 |Exit;..}|.../* Cr|
|00003190| 65 61 74 65 20 74 68 65 | 20 64 65 73 74 69 6e 61 |eate the| destina|
|000031a0| 74 69 6f 6e 20 66 69 6c | 65 2e 20 2a 2f 0d 09 65 |tion fil|e. */..e|
|000031b0| 72 72 20 3d 20 48 43 72 | 65 61 74 65 4d 69 6e 69 |rr = HCr|eateMini|
|000031c0| 6d 75 6d 28 64 73 74 56 | 52 65 66 4e 75 6d 2c 20 |mum(dstV|RefNum, |
|000031d0| 64 73 74 44 69 72 49 44 | 2c 20 64 73 74 4e 61 6d |dstDirID|, dstNam|
|000031e0| 65 29 3b 0d 09 69 66 20 | 28 20 65 72 72 20 21 3d |e);..if |( err !=|
|000031f0| 20 6e 6f 45 72 72 20 29 | 0d 09 09 67 6f 74 6f 20 | noErr )|...goto |
|00003200| 45 72 72 6f 72 45 78 69 | 74 3b 0d 09 64 73 74 43 |ErrorExi|t;..dstC|
|00003210| 72 65 61 74 65 64 20 3d | 20 74 72 75 65 3b 09 2f |reated =| true;./|
|00003220| 2a 20 41 66 74 65 72 20 | 63 72 65 61 74 69 6e 67 |* After |creating|
|00003230| 20 74 68 65 20 64 65 73 | 74 69 6e 61 74 69 6f 6e | the des|tination|
|00003240| 20 66 69 6c 65 2c 20 61 | 6e 79 0d 09 09 09 09 09 | file, a|ny......|
|00003250| 09 2a 2a 20 65 72 72 6f | 72 20 63 6f 6e 64 69 74 |.** erro|r condit|
|00003260| 69 6f 6e 73 20 73 68 6f | 75 6c 64 20 64 65 6c 65 |ions sho|uld dele|
|00003270| 74 65 20 74 68 65 20 64 | 65 73 74 69 6e 61 74 69 |te the d|estinati|
|00003280| 6f 6e 20 66 69 6c 65 20 | 2a 2f 0d 0d 09 2f 2a 20 |on file |*/.../* |
|00003290| 41 6e 20 41 70 70 6c 65 | 53 68 61 72 65 20 64 72 |An Apple|Share dr|
|000032a0| 6f 70 62 6f 78 20 66 6f | 6c 64 65 72 20 69 73 20 |opbox fo|lder is |
|000032b0| 61 20 66 6f 6c 64 65 72 | 20 66 6f 72 20 77 68 69 |a folder| for whi|
|000032c0| 63 68 20 74 68 65 20 75 | 73 65 72 20 68 61 73 20 |ch the u|ser has |
|000032d0| 74 68 65 20 4d 61 6b 65 | 20 43 68 61 6e 67 65 73 |the Make| Changes|
|000032e0| 0d 09 2a 2a 20 70 72 69 | 76 69 6c 65 67 65 20 28 |..** pri|vilege (|
|000032f0| 77 72 69 74 65 20 61 63 | 63 65 73 73 29 2c 20 62 |write ac|cess), b|
|00003300| 75 74 20 6e 6f 74 20 53 | 65 65 20 46 69 6c 65 73 |ut not S|ee Files|
|00003310| 20 28 72 65 61 64 20 61 | 63 63 65 73 73 29 20 61 | (read a|ccess) a|
|00003320| 6e 64 20 53 65 65 20 46 | 6f 6c 64 65 72 73 20 28 |nd See F|olders (|
|00003330| 73 65 61 72 63 68 20 61 | 63 63 65 73 73 29 2e 0d |search a|ccess)..|
|00003340| 09 2a 2a 20 43 6f 70 79 | 69 6e 67 20 61 20 66 69 |.** Copy|ing a fi|
|00003350| 6c 65 20 69 6e 74 6f 20 | 61 6e 20 41 70 70 6c 65 |le into |an Apple|
|00003360| 53 68 61 72 65 20 64 72 | 6f 70 62 6f 78 20 70 72 |Share dr|opbox pr|
|00003370| 65 73 65 6e 74 73 20 73 | 6f 6d 65 20 73 70 65 63 |esents s|ome spec|
|00003380| 69 61 6c 20 70 72 6f 62 | 6c 65 6d 73 2e 20 48 65 |ial prob|lems. He|
|00003390| 72 65 20 61 72 65 20 74 | 68 65 0d 09 2a 2a 20 72 |re are t|he..** r|
|000033a0| 75 6c 65 73 20 77 65 20 | 68 61 76 65 20 74 6f 20 |ules we |have to |
|000033b0| 66 6f 6c 6c 6f 77 20 74 | 6f 20 63 6f 70 79 20 61 |follow t|o copy a|
|000033c0| 20 66 69 6c 65 20 69 6e | 74 6f 20 61 20 64 72 6f | file in|to a dro|
|000033d0| 70 62 6f 78 3a 0d 09 2a | 2a 20 a5 20 46 69 6c 65 |pbox:..*|* . File|
|000033e0| 20 61 74 74 72 69 62 75 | 74 65 73 20 63 61 6e 20 | attribu|tes can |
|000033f0| 62 65 20 63 68 61 6e 67 | 65 64 20 6f 6e 6c 79 20 |be chang|ed only |
|00003400| 77 68 65 6e 20 62 6f 74 | 68 20 66 6f 72 6b 73 20 |when bot|h forks |
|00003410| 6f 66 20 61 20 66 69 6c | 65 20 61 72 65 20 65 6d |of a fil|e are em|
|00003420| 70 74 79 2e 0d 09 2a 2a | 20 a5 20 44 65 73 6b 54 |pty...**| . DeskT|
|00003430| 6f 70 20 4d 61 6e 61 67 | 65 72 20 63 6f 6d 6d 65 |op Manag|er comme|
|00003440| 6e 74 73 20 63 61 6e 20 | 62 65 20 61 64 64 65 64 |nts can |be added|
|00003450| 20 74 6f 20 61 20 66 69 | 6c 65 20 6f 6e 6c 79 20 | to a fi|le only |
|00003460| 77 68 65 6e 20 62 6f 74 | 68 20 66 6f 72 6b 73 20 |when bot|h forks |
|00003470| 6f 66 20 61 20 66 69 6c | 65 20 0d 09 2a 2a 20 20 |of a fil|e ..** |
|00003480| 20 61 72 65 20 65 6d 70 | 74 79 2e 0d 09 2a 2a 20 | are emp|ty...** |
|00003490| a5 20 41 20 66 6f 72 6b | 20 63 61 6e 20 62 65 20 |. A fork| can be |
|000034a0| 6f 70 65 6e 65 64 20 66 | 6f 72 20 77 72 69 74 65 |opened f|or write|
|000034b0| 20 61 63 63 65 73 73 20 | 6f 6e 6c 79 20 77 68 65 | access |only whe|
|000034c0| 6e 20 62 6f 74 68 20 66 | 6f 72 6b 73 20 6f 66 20 |n both f|orks of |
|000034d0| 61 20 66 69 6c 65 20 61 | 72 65 20 65 6d 70 74 79 |a file a|re empty|
|000034e0| 2e 0d 09 2a 2a 20 53 6f | 2c 20 77 69 74 68 20 74 |...** So|, with t|
|000034f0| 68 6f 73 65 20 72 75 6c | 65 73 20 74 6f 20 6c 69 |hose rul|es to li|
|00003500| 76 65 20 77 69 74 68 2c | 20 77 65 27 6c 6c 20 64 |ve with,| we'll d|
|00003510| 6f 20 74 68 6f 73 65 20 | 6f 70 65 72 61 74 69 6f |o those |operatio|
|00003520| 6e 73 20 6e 6f 77 20 77 | 68 69 6c 65 20 62 6f 74 |ns now w|hile bot|
|00003530| 68 20 66 6f 72 6b 73 0d | 09 2a 2a 20 61 72 65 20 |h forks.|.** are |
|00003540| 65 6d 70 74 79 2e 20 2a | 2f 0d 0d 09 69 66 20 28 |empty. *|/...if (|
|00003550| 20 69 73 44 72 6f 70 42 | 6f 78 20 29 0d 09 7b 0d | isDropB|ox )..{.|
|00003560| 09 09 2f 2a 20 57 65 20 | 6f 6e 6c 79 20 73 65 74 |../* We |only set|
|00003570| 20 74 68 65 20 66 69 6c | 65 20 61 74 74 72 69 62 | the fil|e attrib|
|00003580| 75 74 65 73 20 6e 6f 77 | 20 69 66 20 74 68 65 20 |utes now| if the |
|00003590| 66 69 6c 65 20 69 73 20 | 62 65 69 6e 67 20 63 6f |file is |being co|
|000035a0| 70 69 65 64 20 69 6e 74 | 6f 20 61 0d 09 09 2a 2a |pied int|o a...**|
|000035b0| 20 64 72 6f 70 20 62 6f | 78 2e 20 49 6e 20 61 6c | drop bo|x. In al|
|000035c0| 6c 20 6f 74 68 65 72 20 | 63 61 73 65 73 2c 20 69 |l other |cases, i|
|000035d0| 74 20 69 73 20 62 65 74 | 74 65 72 20 74 6f 20 73 |t is bet|ter to s|
|000035e0| 65 74 20 74 68 65 20 61 | 74 74 72 69 62 75 74 65 |et the a|ttribute|
|000035f0| 73 20 6c 61 73 74 0d 09 | 09 2a 2a 20 73 6f 20 74 |s last..|.** so t|
|00003600| 68 61 74 20 69 66 20 46 | 69 6c 65 43 6f 70 79 20 |hat if F|ileCopy |
|00003610| 69 73 20 6d 6f 64 69 66 | 69 65 64 20 74 6f 20 67 |is modif|ied to g|
|00003620| 69 76 65 20 75 70 20 74 | 69 6d 65 20 74 6f 20 6f |ive up t|ime to o|
|00003630| 74 68 65 72 20 70 72 6f | 63 65 73 73 65 73 0d 09 |ther pro|cesses..|
|00003640| 09 2a 2a 20 70 65 72 69 | 6f 64 69 63 6c 79 2c 20 |.** peri|odicly, |
|00003650| 74 68 65 20 46 69 6e 64 | 65 72 20 77 6f 6e 27 74 |the Find|er won't|
|00003660| 20 74 72 79 20 74 6f 20 | 72 65 61 64 20 61 6e 79 | try to |read any|
|00003670| 20 62 75 6e 64 6c 65 20 | 69 6e 66 6f 72 6d 61 74 | bundle |informat|
|00003680| 69 6f 6e 20 28 62 65 63 | 61 75 73 65 0d 09 09 2a |ion (bec|ause...*|
|00003690| 2a 20 74 68 65 20 62 75 | 6e 64 6c 65 2d 62 69 74 |* the bu|ndle-bit|
|000036a0| 20 77 69 6c 6c 20 73 74 | 69 6c 6c 20 62 65 20 63 | will st|ill be c|
|000036b0| 6c 65 61 72 29 20 66 72 | 6f 6d 20 61 20 70 61 72 |lear) fr|om a par|
|000036c0| 74 69 61 6c 6c 79 20 63 | 6f 70 69 65 64 20 66 69 |tially c|opied fi|
|000036d0| 6c 65 2e 20 49 66 20 74 | 68 65 0d 09 09 2a 2a 20 |le. If t|he...** |
|000036e0| 63 6f 70 79 20 69 73 20 | 69 6e 74 6f 20 61 20 64 |copy is |into a d|
|000036f0| 72 6f 70 20 62 6f 78 2c | 20 77 65 20 68 61 76 65 |rop box,| we have|
|00003700| 20 74 6f 20 73 65 74 20 | 74 68 65 20 61 74 74 72 | to set |the attr|
|00003710| 69 62 75 74 65 73 20 6e | 6f 77 2c 20 62 75 74 20 |ibutes n|ow, but |
|00003720| 73 69 6e 63 65 20 74 68 | 65 0d 09 09 2a 2a 20 64 |since th|e...** d|
|00003730| 65 73 74 69 6e 61 74 69 | 6f 6e 20 66 6f 72 6b 73 |estinati|on forks|
|00003740| 20 61 72 65 20 6f 70 65 | 6e 65 64 20 77 69 74 68 | are ope|ned with|
|00003750| 20 77 72 69 74 65 2f 64 | 65 6e 79 2d 72 65 61 64 | write/d|eny-read|
|00003760| 2f 64 65 6e 79 2d 77 72 | 69 74 65 20 70 65 72 6d |/deny-wr|ite perm|
|00003770| 69 73 73 69 6f 6e 73 2c | 0d 09 09 2a 2a 20 61 6e |issions,|...** an|
|00003780| 79 20 46 69 6e 64 65 72 | 20 74 68 61 74 20 6d 69 |y Finder| that mi|
|00003790| 67 68 74 20 73 65 65 20 | 74 68 65 20 66 69 6c 65 |ght see |the file|
|000037a0| 20 69 6e 20 74 68 65 20 | 64 72 6f 70 20 62 6f 78 | in the |drop box|
|000037b0| 20 77 6f 6e 27 74 20 62 | 65 20 61 62 6c 65 20 74 | won't b|e able t|
|000037c0| 6f 20 6f 70 65 6e 0d 09 | 09 2a 2a 20 69 74 73 20 |o open..|.** its |
|000037d0| 72 65 73 6f 75 72 63 65 | 20 66 6f 72 6b 20 75 6e |resource| fork un|
|000037e0| 74 69 6c 20 74 68 65 20 | 72 65 73 6f 75 72 63 65 |til the |resource|
|000037f0| 20 66 6f 72 6b 20 69 73 | 20 63 6c 6f 73 65 64 2e | fork is| closed.|
|00003800| 0d 09 09 2a 2a 0d 09 09 | 2a 2a 20 4e 6f 74 65 3a |...**...|** Note:|
|00003810| 20 69 66 20 79 6f 75 20 | 64 6f 20 6d 6f 64 69 66 | if you |do modif|
|00003820| 79 20 46 69 6c 65 43 6f | 70 79 20 74 6f 20 67 69 |y FileCo|py to gi|
|00003830| 76 65 20 75 70 20 74 69 | 6d 65 20 74 6f 20 6f 74 |ve up ti|me to ot|
|00003840| 68 65 72 20 70 72 6f 63 | 65 73 73 65 73 2c 20 64 |her proc|esses, d|
|00003850| 6f 6e 27 74 0d 09 09 2a | 2a 20 67 69 76 65 20 75 |on't...*|* give u|
|00003860| 70 20 74 69 6d 65 20 62 | 65 74 77 65 65 6e 20 74 |p time b|etween t|
|00003870| 68 65 20 74 69 6d 65 20 | 74 68 65 20 64 65 73 74 |he time |the dest|
|00003880| 69 6e 61 74 69 6f 6e 20 | 66 69 6c 65 20 69 73 20 |ination |file is |
|00003890| 63 72 65 61 74 65 64 20 | 28 61 62 6f 76 65 29 20 |created |(above) |
|000038a0| 61 6e 64 0d 09 09 2a 2a | 20 74 68 65 20 74 69 6d |and...**| the tim|
|000038b0| 65 20 62 6f 74 68 20 66 | 6f 72 6b 73 20 61 72 65 |e both f|orks are|
|000038c0| 20 6f 70 65 6e 65 64 20 | 28 62 65 6c 6f 77 29 2e | opened |(below).|
|000038d0| 20 54 68 61 74 20 77 61 | 79 2c 20 79 6f 75 20 73 | That wa|y, you s|
|000038e0| 74 61 6e 64 20 74 68 65 | 20 62 65 73 74 20 63 68 |tand the| best ch|
|000038f0| 61 6e 63 65 0d 09 09 2a | 2a 20 6f 66 20 6d 61 6b |ance...*|* of mak|
|00003900| 69 6e 67 20 73 75 72 65 | 20 74 68 65 20 46 69 6e |ing sure| the Fin|
|00003910| 64 65 72 20 64 6f 65 73 | 6e 27 74 20 72 65 61 64 |der does|n't read|
|00003920| 20 61 20 70 61 72 74 69 | 61 6c 6c 79 20 63 6f 70 | a parti|ally cop|
|00003930| 69 65 64 20 72 65 73 6f | 75 72 63 65 20 66 6f 72 |ied reso|urce for|
|00003940| 6b 2e 0d 09 09 2a 2f 0d | 09 09 2f 2a 20 43 6f 70 |k....*/.|../* Cop|
|00003950| 79 20 61 74 74 72 69 62 | 75 74 65 73 20 62 75 74 |y attrib|utes but|
|00003960| 20 64 6f 6e 27 74 20 6c | 6f 63 6b 20 74 68 65 20 | don't l|ock the |
|00003970| 64 65 73 74 69 6e 61 74 | 69 6f 6e 2e 20 2a 2f 0d |destinat|ion. */.|
|00003980| 09 09 65 72 72 20 3d 20 | 43 6f 70 79 46 69 6c 65 |..err = |CopyFile|
|00003990| 4d 67 72 41 74 74 72 69 | 62 75 74 65 73 28 73 72 |MgrAttri|butes(sr|
|000039a0| 63 56 52 65 66 4e 75 6d | 2c 20 73 72 63 44 69 72 |cVRefNum|, srcDir|
|000039b0| 49 44 2c 20 28 53 74 72 | 69 6e 67 50 74 72 29 73 |ID, (Str|ingPtr)s|
|000039c0| 72 63 4e 61 6d 65 2c 0d | 09 09 09 09 09 09 09 09 |rcName,.|........|
|000039d0| 09 64 73 74 56 52 65 66 | 4e 75 6d 2c 20 64 73 74 |.dstVRef|Num, dst|
|000039e0| 44 69 72 49 44 2c 20 28 | 53 74 72 69 6e 67 50 74 |DirID, (|StringPt|
|000039f0| 72 29 26 64 73 74 4e 61 | 6d 65 2c 20 66 61 6c 73 |r)&dstNa|me, fals|
|00003a00| 65 29 3b 0d 09 09 69 66 | 20 28 20 65 72 72 20 21 |e);...if| ( err !|
|00003a10| 3d 20 6e 6f 45 72 72 20 | 29 0d 09 09 09 67 6f 74 |= noErr |)....got|
|00003a20| 6f 20 45 72 72 6f 72 45 | 78 69 74 3b 0d 09 7d 0d |o ErrorE|xit;..}.|
|00003a30| 0d 09 2f 2a 20 41 74 74 | 65 6d 70 74 20 74 6f 20 |../* Att|empt to |
|00003a40| 63 6f 70 79 20 74 68 65 | 20 63 6f 6d 6d 65 6e 74 |copy the| comment|
|00003a50| 73 20 77 68 69 6c 65 20 | 62 6f 74 68 20 66 6f 72 |s while |both for|
|00003a60| 6b 73 20 61 72 65 20 65 | 6d 70 74 79 2e 0d 09 2a |ks are e|mpty...*|
|00003a70| 2a 20 49 67 6e 6f 72 65 | 20 74 68 65 20 72 65 73 |* Ignore| the res|
|00003a80| 75 6c 74 20 62 65 63 61 | 75 73 65 20 77 65 20 72 |ult beca|use we r|
|00003a90| 65 61 6c 6c 79 20 64 6f | 6e 27 74 20 63 61 72 65 |eally do|n't care|
|00003aa0| 20 69 66 20 69 74 20 77 | 6f 72 6b 65 64 20 6f 72 | if it w|orked or|
|00003ab0| 20 6e 6f 74 2e 20 2a 2f | 0d 09 28 76 6f 69 64 29 | not. */|..(void)|
|00003ac0| 20 44 54 43 6f 70 79 43 | 6f 6d 6d 65 6e 74 28 73 | DTCopyC|omment(s|
|00003ad0| 72 63 56 52 65 66 4e 75 | 6d 2c 20 73 72 63 44 69 |rcVRefNu|m, srcDi|
|00003ae0| 72 49 44 2c 20 28 53 74 | 72 69 6e 67 50 74 72 29 |rID, (St|ringPtr)|
|00003af0| 73 72 63 4e 61 6d 65 2c | 20 64 73 74 56 52 65 66 |srcName,| dstVRef|
|00003b00| 4e 75 6d 2c 20 64 73 74 | 44 69 72 49 44 2c 20 28 |Num, dst|DirID, (|
|00003b10| 53 74 72 69 6e 67 50 74 | 72 29 26 64 73 74 4e 61 |StringPt|r)&dstNa|
|00003b20| 6d 65 29 3b 0d 0d 09 2f | 2a 20 53 65 65 20 77 68 |me);.../|* See wh|
|00003b30| 69 63 68 20 66 6f 72 6b | 73 20 77 65 20 6e 65 65 |ich fork|s we nee|
|00003b40| 64 20 74 6f 20 63 6f 70 | 79 2e 20 42 79 20 64 6f |d to cop|y. By do|
|00003b50| 69 6e 67 20 74 68 69 73 | 2c 20 77 65 20 77 6f 6e |ing this|, we won|
|00003b60| 27 74 20 63 72 65 61 74 | 65 20 61 20 64 61 74 61 |'t creat|e a data|
|00003b70| 20 6f 72 20 72 65 73 6f | 75 72 63 65 20 66 6f 72 | or reso|urce for|
|00003b80| 6b 0d 09 2a 2a 20 66 6f | 72 20 74 68 65 20 64 65 |k..** fo|r the de|
|00003b90| 73 74 69 6e 61 74 69 6f | 6e 20 75 6e 6c 65 73 73 |stinatio|n unless|
|00003ba0| 20 69 74 27 73 20 72 65 | 61 6c 6c 79 20 6e 65 65 | it's re|ally nee|
|00003bb0| 64 65 64 20 28 73 6f 6d | 65 20 66 6f 72 65 69 67 |ded (som|e foreig|
|00003bc0| 6e 20 66 69 6c 65 20 73 | 79 73 74 65 6d 73 20 73 |n file s|ystems s|
|00003bd0| 75 63 68 20 61 73 0d 09 | 2a 2a 20 74 68 65 20 50 |uch as..|** the P|
|00003be0| 72 6f 44 4f 53 20 46 69 | 6c 65 20 53 79 73 74 65 |roDOS Fi|le Syste|
|00003bf0| 6d 20 61 6e 64 20 4d 61 | 63 69 6e 74 6f 73 68 20 |m and Ma|cintosh |
|00003c00| 50 43 20 45 78 63 68 61 | 6e 67 65 20 68 61 76 65 |PC Excha|nge have|
|00003c10| 20 74 6f 20 63 72 65 61 | 74 65 20 61 64 64 69 74 | to crea|te addit|
|00003c20| 69 6f 6e 61 6c 20 64 69 | 73 6b 0d 09 2a 2a 20 73 |ional di|sk..** s|
|00003c30| 74 72 75 63 74 75 72 65 | 73 20 74 6f 20 73 75 70 |tructure|s to sup|
|00003c40| 70 6f 72 74 20 72 65 73 | 6f 75 72 63 65 20 66 6f |port res|ource fo|
|00003c50| 72 6b 73 29 2e 20 2a 2f | 0d 09 65 72 72 20 3d 20 |rks). */|..err = |
|00003c60| 43 68 65 63 6b 46 6f 72 | 46 6f 72 6b 73 28 73 72 |CheckFor|Forks(sr|
|00003c70| 63 56 52 65 66 4e 75 6d | 2c 20 73 72 63 44 69 72 |cVRefNum|, srcDir|
|00003c80| 49 44 2c 20 73 72 63 4e | 61 6d 65 2c 20 26 68 61 |ID, srcN|ame, &ha|
|00003c90| 73 44 61 74 61 46 6f 72 | 6b 2c 20 26 68 61 73 52 |sDataFor|k, &hasR|
|00003ca0| 65 73 6f 75 72 63 65 46 | 6f 72 6b 29 3b 0d 09 69 |esourceF|ork);..i|
|00003cb0| 66 20 28 20 65 72 72 20 | 21 3d 20 6e 6f 45 72 72 |f ( err |!= noErr|
|00003cc0| 20 29 0d 09 09 67 6f 74 | 6f 20 45 72 72 6f 72 45 | )...got|o ErrorE|
|00003cd0| 78 69 74 3b 09 0d 09 0d | 09 69 66 20 28 20 68 61 |xit;....|.if ( ha|
|00003ce0| 73 44 61 74 61 46 6f 72 | 6b 20 29 0d 09 7b 0d 09 |sDataFor|k )..{..|
|00003cf0| 09 2f 2a 20 4f 70 65 6e | 20 74 68 65 20 64 65 73 |./* Open| the des|
|00003d00| 74 69 6e 61 74 69 6f 6e | 20 64 61 74 61 20 66 6f |tination| data fo|
|00003d10| 72 6b 2e 20 2a 2f 0d 09 | 09 65 72 72 20 3d 20 48 |rk. */..|.err = H|
|00003d20| 4f 70 65 6e 41 77 61 72 | 65 28 64 73 74 56 52 65 |OpenAwar|e(dstVRe|
|00003d30| 66 4e 75 6d 2c 20 64 73 | 74 44 69 72 49 44 2c 20 |fNum, ds|tDirID, |
|00003d40| 64 73 74 4e 61 6d 65 2c | 20 64 73 74 43 6f 70 79 |dstName,| dstCopy|
|00003d50| 4d 6f 64 65 2c 20 26 64 | 73 74 44 61 74 61 52 65 |Mode, &d|stDataRe|
|00003d60| 66 4e 75 6d 29 3b 0d 09 | 09 69 66 20 28 20 65 72 |fNum);..|.if ( er|
|00003d70| 72 20 21 3d 20 6e 6f 45 | 72 72 20 29 0d 09 09 09 |r != noE|rr )....|
|00003d80| 67 6f 74 6f 20 45 72 72 | 6f 72 45 78 69 74 3b 0d |goto Err|orExit;.|
|00003d90| 09 7d 0d 0d 09 69 66 20 | 28 20 68 61 73 52 65 73 |.}...if |( hasRes|
|00003da0| 6f 75 72 63 65 46 6f 72 | 6b 20 29 0d 09 7b 0d 09 |ourceFor|k )..{..|
|00003db0| 09 2f 2a 20 4f 70 65 6e | 20 74 68 65 20 64 65 73 |./* Open| the des|
|00003dc0| 74 69 6e 61 74 69 6f 6e | 20 72 65 73 6f 75 72 63 |tination| resourc|
|00003dd0| 65 20 66 6f 72 6b 2e 20 | 2a 2f 0d 09 09 65 72 72 |e fork. |*/...err|
|00003de0| 20 3d 20 48 4f 70 65 6e | 52 46 41 77 61 72 65 28 | = HOpen|RFAware(|
|00003df0| 64 73 74 56 52 65 66 4e | 75 6d 2c 20 64 73 74 44 |dstVRefN|um, dstD|
|00003e00| 69 72 49 44 2c 20 64 73 | 74 4e 61 6d 65 2c 20 64 |irID, ds|tName, d|
|00003e10| 73 74 43 6f 70 79 4d 6f | 64 65 2c 20 26 64 73 74 |stCopyMo|de, &dst|
|00003e20| 52 73 72 63 52 65 66 4e | 75 6d 29 3b 0d 09 09 69 |RsrcRefN|um);...i|
|00003e30| 66 20 28 20 65 72 72 20 | 21 3d 20 6e 6f 45 72 72 |f ( err |!= noErr|
|00003e40| 20 29 0d 09 09 09 67 6f | 74 6f 20 45 72 72 6f 72 | )....go|to Error|
|00003e50| 45 78 69 74 3b 0d 09 7d | 0d 0d 09 69 66 20 28 20 |Exit;..}|...if ( |
|00003e60| 68 61 73 44 61 74 61 46 | 6f 72 6b 20 29 0d 09 7b |hasDataF|ork )..{|
|00003e70| 0d 09 09 2f 2a 20 43 6f | 70 79 20 74 68 65 20 64 |.../* Co|py the d|
|00003e80| 61 74 61 20 66 6f 72 6b | 2e 20 2a 2f 0d 09 09 65 |ata fork|. */...e|
|00003e90| 72 72 20 3d 20 43 6f 70 | 79 46 6f 72 6b 28 73 72 |rr = Cop|yFork(sr|
|00003ea0| 63 52 65 66 4e 75 6d 2c | 20 64 73 74 44 61 74 61 |cRefNum,| dstData|
|00003eb0| 52 65 66 4e 75 6d 2c 20 | 63 6f 70 79 42 75 66 66 |RefNum, |copyBuff|
|00003ec0| 65 72 50 74 72 2c 20 63 | 6f 70 79 42 75 66 66 65 |erPtr, c|opyBuffe|
|00003ed0| 72 53 69 7a 65 29 3b 0d | 09 09 69 66 20 28 20 65 |rSize);.|..if ( e|
|00003ee0| 72 72 20 21 3d 20 6e 6f | 45 72 72 20 29 0d 09 09 |rr != no|Err )...|
|00003ef0| 09 67 6f 74 6f 20 45 72 | 72 6f 72 45 78 69 74 3b |.goto Er|rorExit;|
|00003f00| 0d 09 0d 09 09 2f 2a 20 | 43 6c 6f 73 65 20 62 6f |...../* |Close bo|
|00003f10| 74 68 20 64 61 74 61 20 | 66 6f 72 6b 73 20 61 6e |th data |forks an|
|00003f20| 64 20 63 6c 65 61 72 20 | 72 65 66 65 72 65 6e 63 |d clear |referenc|
|00003f30| 65 20 6e 75 6d 62 65 72 | 73 2e 20 2a 2f 0d 09 09 |e number|s. */...|
|00003f40| 46 53 43 6c 6f 73 65 28 | 73 72 63 52 65 66 4e 75 |FSClose(|srcRefNu|
|00003f50| 6d 29 3b 0d 09 09 46 53 | 43 6c 6f 73 65 28 64 73 |m);...FS|Close(ds|
|00003f60| 74 44 61 74 61 52 65 66 | 4e 75 6d 29 3b 0d 09 09 |tDataRef|Num);...|
|00003f70| 73 72 63 52 65 66 4e 75 | 6d 20 3d 20 64 73 74 44 |srcRefNu|m = dstD|
|00003f80| 61 74 61 52 65 66 4e 75 | 6d 20 3d 20 30 3b 0d 09 |ataRefNu|m = 0;..|
|00003f90| 7d 0d 09 65 6c 73 65 0d | 09 7b 0d 09 09 2f 2a 20 |}..else.|.{.../* |
|00003fa0| 43 6c 6f 73 65 20 74 68 | 65 20 73 6f 75 72 63 65 |Close th|e source|
|00003fb0| 20 64 61 74 61 20 66 6f | 72 6b 20 73 69 6e 63 65 | data fo|rk since|
|00003fc0| 20 69 74 20 77 61 73 20 | 6f 70 65 6e 65 64 20 65 | it was |opened e|
|00003fd0| 61 72 6c 69 65 72 20 2a | 2f 0d 09 09 46 53 43 6c |arlier *|/...FSCl|
|00003fe0| 6f 73 65 28 73 72 63 52 | 65 66 4e 75 6d 29 3b 0d |ose(srcR|efNum);.|
|00003ff0| 09 09 73 72 63 52 65 66 | 4e 75 6d 20 3d 20 30 3b |..srcRef|Num = 0;|
|00004000| 0d 09 7d 0d 0d 09 69 66 | 20 28 20 68 61 73 52 65 |..}...if| ( hasRe|
|00004010| 73 6f 75 72 63 65 46 6f | 72 6b 20 29 0d 09 7b 0d |sourceFo|rk )..{.|
|00004020| 09 09 2f 2a 20 4f 70 65 | 6e 20 74 68 65 20 73 6f |../* Ope|n the so|
|00004030| 75 72 63 65 20 72 65 73 | 6f 75 72 63 65 20 66 6f |urce res|ource fo|
|00004040| 72 6b 2e 20 2a 2f 0d 09 | 09 65 72 72 20 3d 20 48 |rk. */..|.err = H|
|00004050| 4f 70 65 6e 52 46 41 77 | 61 72 65 28 73 72 63 56 |OpenRFAw|are(srcV|
|00004060| 52 65 66 4e 75 6d 2c 20 | 73 72 63 44 69 72 49 44 |RefNum, |srcDirID|
|00004070| 2c 20 73 72 63 4e 61 6d | 65 2c 20 73 72 63 43 6f |, srcNam|e, srcCo|
|00004080| 70 79 4d 6f 64 65 2c 20 | 26 73 72 63 52 65 66 4e |pyMode, |&srcRefN|
|00004090| 75 6d 29 3b 0d 09 09 69 | 66 20 28 20 65 72 72 20 |um);...i|f ( err |
|000040a0| 21 3d 20 6e 6f 45 72 72 | 20 29 0d 09 09 09 67 6f |!= noErr| )....go|
|000040b0| 74 6f 20 45 72 72 6f 72 | 45 78 69 74 3b 0d 09 0d |to Error|Exit;...|
|000040c0| 09 09 2f 2a 20 43 6f 70 | 79 20 74 68 65 20 72 65 |../* Cop|y the re|
|000040d0| 73 6f 75 72 63 65 20 66 | 6f 72 6b 2e 20 2a 2f 0d |source f|ork. */.|
|000040e0| 09 09 65 72 72 20 3d 20 | 43 6f 70 79 46 6f 72 6b |..err = |CopyFork|
|000040f0| 28 73 72 63 52 65 66 4e | 75 6d 2c 20 64 73 74 52 |(srcRefN|um, dstR|
|00004100| 73 72 63 52 65 66 4e 75 | 6d 2c 20 63 6f 70 79 42 |srcRefNu|m, copyB|
|00004110| 75 66 66 65 72 50 74 72 | 2c 20 63 6f 70 79 42 75 |ufferPtr|, copyBu|
|00004120| 66 66 65 72 53 69 7a 65 | 29 3b 0d 09 09 69 66 20 |fferSize|);...if |
|00004130| 28 20 65 72 72 20 21 3d | 20 6e 6f 45 72 72 20 29 |( err !=| noErr )|
|00004140| 0d 09 09 09 67 6f 74 6f | 20 45 72 72 6f 72 45 78 |....goto| ErrorEx|
|00004150| 69 74 3b 0d 09 0d 09 09 | 2f 2a 20 43 6c 6f 73 65 |it;.....|/* Close|
|00004160| 20 62 6f 74 68 20 72 65 | 73 6f 75 72 63 65 20 66 | both re|source f|
|00004170| 6f 72 6b 73 20 61 6e 64 | 20 63 6c 65 61 72 20 72 |orks and| clear r|
|00004180| 65 66 65 72 65 6e 63 65 | 20 6e 75 6d 62 65 72 73 |eference| numbers|
|00004190| 2e 20 2a 2f 0d 09 09 46 | 53 43 6c 6f 73 65 28 73 |. */...F|SClose(s|
|000041a0| 72 63 52 65 66 4e 75 6d | 29 3b 0d 09 09 46 53 43 |rcRefNum|);...FSC|
|000041b0| 6c 6f 73 65 28 64 73 74 | 52 73 72 63 52 65 66 4e |lose(dst|RsrcRefN|
|000041c0| 75 6d 29 3b 0d 09 09 73 | 72 63 52 65 66 4e 75 6d |um);...s|rcRefNum|
|000041d0| 20 3d 20 64 73 74 52 73 | 72 63 52 65 66 4e 75 6d | = dstRs|rcRefNum|
|000041e0| 20 3d 20 30 3b 0d 09 7d | 0d 0d 09 2f 2a 20 47 65 | = 0;..}|.../* Ge|
|000041f0| 74 20 72 69 64 20 6f 66 | 20 74 68 65 20 63 6f 70 |t rid of| the cop|
|00004200| 79 20 62 75 66 66 65 72 | 20 69 66 20 77 65 20 61 |y buffer| if we a|
|00004210| 6c 6c 6f 63 61 74 65 64 | 20 69 74 2e 20 2a 2f 0d |llocated| it. */.|
|00004220| 09 69 66 20 28 20 6f 75 | 72 43 6f 70 79 42 75 66 |.if ( ou|rCopyBuf|
|00004230| 66 65 72 20 29 0d 09 09 | 44 69 73 70 6f 73 50 74 |fer )...|DisposPt|
|00004240| 72 28 63 6f 70 79 42 75 | 66 66 65 72 50 74 72 29 |r(copyBu|fferPtr)|
|00004250| 3b 0d 0d 09 2f 2a 20 41 | 74 74 65 6d 70 74 20 74 |;.../* A|ttempt t|
|00004260| 6f 20 63 6f 70 79 20 61 | 74 74 72 69 62 75 74 65 |o copy a|ttribute|
|00004270| 73 20 61 67 61 69 6e 20 | 74 6f 20 73 65 74 20 6d |s again |to set m|
|00004280| 6f 64 20 64 61 74 65 2e | 20 20 43 6f 70 79 20 6c |od date.| Copy l|
|00004290| 6f 63 6b 20 63 6f 6e 64 | 69 74 69 6f 6e 20 74 68 |ock cond|ition th|
|000042a0| 69 73 20 74 69 6d 65 0d | 09 2a 2a 20 73 69 6e 63 |is time.|.** sinc|
|000042b0| 65 20 77 65 27 72 65 20 | 64 6f 6e 65 20 77 69 74 |e we're |done wit|
|000042c0| 68 20 74 68 65 20 63 6f | 70 79 20 6f 70 65 72 61 |h the co|py opera|
|000042d0| 74 69 6f 6e 2e 20 20 54 | 68 69 73 20 6f 70 65 72 |tion. T|his oper|
|000042e0| 61 74 69 6f 6e 20 77 69 | 6c 6c 20 66 61 69 6c 20 |ation wi|ll fail |
|000042f0| 69 66 20 77 65 27 72 65 | 20 63 6f 70 79 69 6e 67 |if we're| copying|
|00004300| 0d 09 2a 2a 20 69 6e 74 | 6f 20 61 6e 20 41 70 70 |..** int|o an App|
|00004310| 6c 65 53 68 61 72 65 20 | 64 72 6f 70 62 6f 78 2c |leShare |dropbox,|
|00004320| 20 73 6f 20 77 65 20 64 | 6f 6e 27 74 20 63 68 65 | so we d|on't che|
|00004330| 63 6b 20 66 6f 72 20 65 | 72 72 6f 72 20 63 6f 6e |ck for e|rror con|
|00004340| 64 69 74 69 6f 6e 73 2e | 20 2a 2f 0d 09 43 6f 70 |ditions.| */..Cop|
|00004350| 79 46 69 6c 65 4d 67 72 | 41 74 74 72 69 62 75 74 |yFileMgr|Attribut|
|00004360| 65 73 28 73 72 63 56 52 | 65 66 4e 75 6d 2c 20 73 |es(srcVR|efNum, s|
|00004370| 72 63 44 69 72 49 44 2c | 20 28 53 74 72 69 6e 67 |rcDirID,| (String|
|00004380| 50 74 72 29 73 72 63 4e | 61 6d 65 2c 0d 09 09 09 |Ptr)srcN|ame,....|
|00004390| 09 09 09 09 64 73 74 56 | 52 65 66 4e 75 6d 2c 20 |....dstV|RefNum, |
|000043a0| 64 73 74 44 69 72 49 44 | 2c 20 28 53 74 72 69 6e |dstDirID|, (Strin|
|000043b0| 67 50 74 72 29 26 64 73 | 74 4e 61 6d 65 2c 20 74 |gPtr)&ds|tName, t|
|000043c0| 72 75 65 29 3b 0d 0d 09 | 2f 2a 20 48 65 79 2c 20 |rue);...|/* Hey, |
|000043d0| 77 65 20 64 69 64 20 69 | 74 21 20 2a 2f 0d 09 72 |we did i|t! */..r|
|000043e0| 65 74 75 72 6e 20 28 20 | 6e 6f 45 72 72 20 29 3b |eturn ( |noErr );|
|000043f0| 0d 09 0d 45 72 72 6f 72 | 45 78 69 74 3a 0d 09 69 |...Error|Exit:..i|
|00004400| 66 20 28 20 73 72 63 52 | 65 66 4e 75 6d 20 21 3d |f ( srcR|efNum !=|
|00004410| 20 30 20 29 0d 09 09 46 | 53 43 6c 6f 73 65 28 73 | 0 )...F|SClose(s|
|00004420| 72 63 52 65 66 4e 75 6d | 29 3b 09 09 2f 2a 20 43 |rcRefNum|);../* C|
|00004430| 6c 6f 73 65 20 74 68 65 | 20 73 6f 75 72 63 65 20 |lose the| source |
|00004440| 66 69 6c 65 20 2a 2f 0d | 09 69 66 20 28 20 64 73 |file */.|.if ( ds|
|00004450| 74 44 61 74 61 52 65 66 | 4e 75 6d 20 21 3d 20 30 |tDataRef|Num != 0|
|00004460| 20 29 0d 09 09 46 53 43 | 6c 6f 73 65 28 64 73 74 | )...FSC|lose(dst|
|00004470| 44 61 74 61 52 65 66 4e | 75 6d 29 3b 09 2f 2a 20 |DataRefN|um);./* |
|00004480| 43 6c 6f 73 65 20 74 68 | 65 20 64 65 73 74 69 6e |Close th|e destin|
|00004490| 61 74 69 6f 6e 20 66 69 | 6c 65 20 64 61 74 61 20 |ation fi|le data |
|000044a0| 66 6f 72 6b 20 2a 2f 0d | 09 69 66 20 28 20 64 73 |fork */.|.if ( ds|
|000044b0| 74 52 73 72 63 52 65 66 | 4e 75 6d 20 21 3d 20 30 |tRsrcRef|Num != 0|
|000044c0| 20 29 0d 09 09 46 53 43 | 6c 6f 73 65 28 64 73 74 | )...FSC|lose(dst|
|000044d0| 52 73 72 63 52 65 66 4e | 75 6d 29 3b 09 2f 2a 20 |RsrcRefN|um);./* |
|000044e0| 43 6c 6f 73 65 20 74 68 | 65 20 64 65 73 74 69 6e |Close th|e destin|
|000044f0| 61 74 69 6f 6e 20 66 69 | 6c 65 20 72 65 73 6f 75 |ation fi|le resou|
|00004500| 72 63 65 20 66 6f 72 6b | 20 2a 2f 0d 09 69 66 20 |rce fork| */..if |
|00004510| 28 20 64 73 74 43 72 65 | 61 74 65 64 20 29 0d 09 |( dstCre|ated )..|
|00004520| 09 48 44 65 6c 65 74 65 | 28 64 73 74 56 52 65 66 |.HDelete|(dstVRef|
|00004530| 4e 75 6d 2c 20 64 73 74 | 44 69 72 49 44 2c 20 64 |Num, dst|DirID, d|
|00004540| 73 74 4e 61 6d 65 29 3b | 09 2f 2a 20 44 65 6c 65 |stName);|./* Dele|
|00004550| 74 65 20 64 65 73 74 20 | 66 69 6c 65 2e 20 20 54 |te dest |file. T|
|00004560| 68 69 73 20 6d 61 79 20 | 66 61 69 6c 20 69 66 20 |his may |fail if |
|00004570| 74 68 65 20 66 69 6c 65 | 20 0d 09 09 09 09 09 09 |the file| .......|
|00004580| 09 09 09 09 09 09 20 20 | 20 69 73 20 69 6e 20 61 |...... | is in a|
|00004590| 20 22 64 72 6f 70 20 66 | 6f 6c 64 65 72 22 20 2a | "drop f|older" *|
|000045a0| 2f 0d 09 69 66 20 28 20 | 6f 75 72 43 6f 70 79 42 |/..if ( |ourCopyB|
|000045b0| 75 66 66 65 72 20 29 09 | 2f 2a 20 64 69 73 70 6f |uffer ).|/* dispo|
|000045c0| 73 65 20 6f 66 20 61 6e | 79 20 6d 65 6d 6f 72 79 |se of an|y memory|
|000045d0| 20 77 65 20 61 6c 6c 6f | 63 61 74 65 64 20 2a 2f | we allo|cated */|
|000045e0| 0d 09 09 44 69 73 70 6f | 73 50 74 72 28 63 6f 70 |...Dispo|sPtr(cop|
|000045f0| 79 42 75 66 66 65 72 50 | 74 72 29 3b 0d 09 72 65 |yBufferP|tr);..re|
|00004600| 74 75 72 6e 20 28 20 65 | 72 72 20 29 3b 0d 7d 0d |turn ( e|rr );.}.|
|00004610| 0d 2f 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |./******|********|
|00004620| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004630| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004640| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004650| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2f |********|*******/|
|00004660| 0d 0d 70 61 73 63 61 6c | 09 4f 53 45 72 72 09 46 |..pascal|.OSErr.F|
|00004670| 53 70 46 69 6c 65 43 6f | 70 79 28 63 6f 6e 73 74 |SpFileCo|py(const|
|00004680| 20 46 53 53 70 65 63 20 | 2a 73 72 63 53 70 65 63 | FSSpec |*srcSpec|
|00004690| 2c 0d 09 09 09 09 09 09 | 09 63 6f 6e 73 74 20 46 |,.......|.const F|
|000046a0| 53 53 70 65 63 20 2a 64 | 73 74 53 70 65 63 2c 0d |SSpec *d|stSpec,.|
|000046b0| 09 09 09 09 09 09 09 53 | 74 72 69 6e 67 50 74 72 |.......S|tringPtr|
|000046c0| 20 63 6f 70 79 4e 61 6d | 65 2c 0d 09 09 09 09 09 | copyNam|e,......|
|000046d0| 09 09 50 74 72 20 63 6f | 70 79 42 75 66 66 65 72 |..Ptr co|pyBuffer|
|000046e0| 50 74 72 2c 0d 09 09 09 | 09 09 09 09 6c 6f 6e 67 |Ptr,....|....long|
|000046f0| 20 63 6f 70 79 42 75 66 | 66 65 72 53 69 7a 65 2c | copyBuf|ferSize,|
|00004700| 0d 09 09 09 09 09 09 09 | 42 6f 6f 6c 65 61 6e 20 |........|Boolean |
|00004710| 70 72 65 66 6c 69 67 68 | 74 29 0d 7b 0d 09 72 65 |prefligh|t).{..re|
|00004720| 74 75 72 6e 20 28 20 46 | 69 6c 65 43 6f 70 79 28 |turn ( F|ileCopy(|
|00004730| 73 72 63 53 70 65 63 2d | 3e 76 52 65 66 4e 75 6d |srcSpec-|>vRefNum|
|00004740| 2c 20 73 72 63 53 70 65 | 63 2d 3e 70 61 72 49 44 |, srcSpe|c->parID|
|00004750| 2c 20 73 72 63 53 70 65 | 63 2d 3e 6e 61 6d 65 2c |, srcSpe|c->name,|
|00004760| 0d 09 09 09 09 09 20 64 | 73 74 53 70 65 63 2d 3e |...... d|stSpec->|
|00004770| 76 52 65 66 4e 75 6d 2c | 20 64 73 74 53 70 65 63 |vRefNum,| dstSpec|
|00004780| 2d 3e 70 61 72 49 44 2c | 20 28 53 74 72 69 6e 67 |->parID,| (String|
|00004790| 50 74 72 29 64 73 74 53 | 70 65 63 2d 3e 6e 61 6d |Ptr)dstS|pec->nam|
|000047a0| 65 2c 0d 09 09 09 09 09 | 20 63 6f 70 79 4e 61 6d |e,......| copyNam|
|000047b0| 65 2c 20 63 6f 70 79 42 | 75 66 66 65 72 50 74 72 |e, copyB|ufferPtr|
|000047c0| 2c 20 63 6f 70 79 42 75 | 66 66 65 72 53 69 7a 65 |, copyBu|fferSize|
|000047d0| 2c 20 70 72 65 66 6c 69 | 67 68 74 29 20 29 3b 0d |, prefli|ght) );.|
|000047e0| 7d 0d 0d 2f 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |}../****|********|
|000047f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004800| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004810| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004820| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004830| 2a 2f 0d 0d 00 00 00 00 | 00 00 00 00 00 00 00 00 |*/......|........|
|00004840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004880| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00004890| 00 00 33 dc 09 52 65 74 | 72 61 63 65 2e 68 02 00 |..3..Ret|race.h..|
|000048a0| 00 00 54 45 58 54 4b 41 | 48 4c 01 00 00 64 01 e0 |..TEXTKA|HL...d..|
|000048b0| 0a 46 69 6c 65 43 6f 70 | 79 2e 63 00 02 00 00 00 |.FileCop|y.c.....|
|000048c0| 54 45 58 54 4b 41 48 4c | 01 00 00 00 00 00 00 00 |TEXTKAHL|........|
|000048d0| 00 00 54 45 58 54 4b 41 | 48 4c 01 00 00 00 00 00 |..TEXTKA|HL......|
|000048e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048f0| 00 00 a8 bc 0b 80 00 00 | 47 b4 00 00 01 7e 00 00 |........|G....~..|
|00004900| 00 00 00 00 0f 00 00 00 | 33 dc 09 52 4f 4d 44 65 |........|3..ROMDe|
|00004910| 66 73 2e 68 02 00 00 00 | 54 45 58 54 4b 41 48 4c |fs.h....|TEXTKAHL|
|00004920| 01 00 00 78 01 e0 00 00 | 00 00 34 2f 00 00 00 00 |...x....|..4/....|
|00004930| 0f 6c 00 00 12 00 00 00 | 00 00 00 00 00 00 00 00 |.l......|........|
|00004940| a9 b5 1a 48 a9 bf 38 8e | 00 00 00 00 00 00 00 00 |...H..8.|........|
|00004950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 5d 55 |........|......]U|
|00004960| 00 03 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004970| 00 00 00 00 00 00 00 00 | 00 00 0d 00 00 00 33 dc |........|......3.|
|00004980| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00004990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049a0| 00 00 00 00 00 00 00 06 | 00 04 00 2a 00 03 02 6d |........|...*...m|
|000049b0| 03 3d 00 26 00 04 02 6c | 03 3c aa 6d af 42 00 00 |.=.&...l|.<.m.B..|
|000049c0| 15 96 00 00 15 9e 00 00 | 00 00 00 00 00 00 01 00 |........|........|
|000049d0| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 83 a7 e0 |...L...L|...2....|
|000049e0| 16 c6 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|000049f0| 00 0a 03 ed ff ff 00 00 | 00 00 00 83 a6 e4 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+